Subvert Trust Controls: Install Root Certificate
Adversaries may install a root certificate on a compromised system to avoid warnings when connecting to adversary controlled web servers. Root certificates are used in public key cryptography to identify a root certificate authority (CA). When a root certificate is installed, the system or application will trust certificates in the root's chain of trust that have been signed by the root certificate.  Certificates are commonly used for establishing secure TLS/SSL communications within a web browser. When a user attempts to browse a website that presents a certificate that is not trusted an error message will be displayed to warn the user of the security risk. Depending on the security settings, the browser may not allow the user to establish a connection to the website.
Installation of a root certificate on a compromised system would give an adversary a way to degrade the security of that system. Adversaries have used this technique to avoid security warnings prompting users when compromised systems connect over HTTPS to adversary controlled web servers that spoof legitimate websites in order to collect login credentials. 
In some cases, illegitimate root certificates were pre-installed on systems by the manufacturer or in the software supply chain and were used in conjunction with malware or adware to provide a Man-in-the-Middle capability for intercepting information transmitted over secure TLS/SSL communications.
Root certificates (and their associated chains) can also be cloned and reinstalled. Cloned certificate chains will carry many of the same metadata characteristics of the source and can be used to sign malicious code that may then bypass signature validation tools (ex: Sysinternals, antivirus, etc.) used to block execution and/or uncover artifacts of Persistence. 
In macOS, the Ay MaMi malware uses
/usr/bin/security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /path/to/malicious/cert to install a malicious certificate as a trusted root certificate into the system keychain. 
APT20 install a root certificate on the victim's machine to evade defenses.
This type of attack technique cannot be easily mitigated with preventive controls since it is based on the abuse of system features.
A system's root certificates are unlikely to change frequently. Monitor new certificates installed on a system that could be due to malicious activity.  Check pre-installed certificates on new systems to ensure unnecessary or suspicious certificates are not present. Microsoft provides a list of trustworthy root certificates online and through authroot.stl.  The Sysinternals Sigcheck utility can also be used (
sigcheck.exe -tuv) to dump the contents of the certificate store and list valid certificates not rooted to the Microsoft Certificate Trust List. 
Installed root certificates are located in the Registry under
[HKLM or HKCU]\Software[\Policies]\Microsoft\SystemCertificates\Root\Certificates\. There are a subset of root certificates that are consistent across Windows systems and can be used for comparison: 
- Wikipedia. (2016, December 6). Root certificate. Retrieved February 20, 2017.
- MITRE ATT&CK
- Sancho, D., Hacquebord, F., Link, R. (2014, July 22). Finding Holes Operation Emmental. Retrieved February 9, 2016.
- Onuma. (2015, February 24). Superfish: Adware Preinstalled on Lenovo Laptops. Retrieved February 20, 2017.
- Graeber, M. (2017, December 22). Code Signing Certificate Cloning Attacks and Defenses. Retrieved April 3, 2018.
- Patrick Wardle. (2018, January 11). Ay MaMi. Retrieved March 19, 2018.
- Russinovich, M. et al.. (2017, May 22). Sigcheck. Retrieved April 3, 2018.
- Smith, T. (2016, October 27). AppUNBlocker: Bypassing AppLocker. Retrieved December 19, 2017.
Created: 21 December 2020
Last Modified: 27 December 2020