T1553.006: Code Signing Policy Modification
Adversaries may modify code signing policies to enable execution of unsigned or self-signed code. Code signing provides a level of authenticity on a program from a developer and a guarantee that the program has not been tampered with. Security controls can include enforcement mechanisms to ensure that only valid, signed code can be run on an operating system.
Some of these security controls may be enabled by default, such as Driver Signature Enforcement (DSE) on Windows or System Integrity Protection (SIP) on macOS. Other such controls may be disabled by default but are configurable through application controls, such as only allowing signed Dynamic-Link Libraries (DLLs) to execute on a system. Since it can be useful for developers to modify default signature enforcement policies during the development and testing of applications, disabling of these features may be possible with elevated permissions.
Adversaries may modify code signing policies in a number of ways, including through use of command-line or GUI utilities, Modify Registry, rebooting the computer in a debug/recovery mode, or by altering the value of variables in kernel memory. Examples of commands that can modify the code signing policy of a system include bcdedit.exe -set TESTSIGNING ON
on Windows and csrutil disable
on macOS. Depending on the implementation, successful modification of a signing policy may require reboot of the compromised system. Additionally, some implementations can introduce visible artifacts for the user (ex: a watermark in the corner of the screen stating the system is in Test Mode). Adversaries may attempt to remove such artifacts.
To gain access to kernel memory to modify variables related to signature checks, such as modifying g_CiOptions
to disable Driver Signature Enforcement, adversaries may conduct Exploitation for Privilege Escalation using a signed, but vulnerable driver.
Positive Technologies products that cover the technique
MaxPatrol SIEM knowledge base
— Monitoring of process-start events with command line input containing 'bcdedit.exe -set TESTSIGNING ON' or 'bcdedit -set TESTSIGNING ON'. — Monitoring of events related to registry key modification at HKCU\Software\Policies\Microsoft\Windows NT\Driver Signing.
Expert Required. The technique is detected only with the combination of «PT Product + Expert»
Detection
ID | DS0017 | Data source and component | Command: Command Execution | Description | Monitor for the execution of commands that could modify the code signing policy of a system, such as |
---|
ID | DS0024 | Data source and component | Windows Registry: Windows Registry Key Modification | Description | Consider monitoring for modifications made to Registry keys associated with code signing policies, such as |
---|
ID | DS0009 | Data source and component | Process: Process Creation | Description | Monitor processes and command-line arguments for actions that could be taken to modify the code signing policy of a system, such as |
---|
Mitigation
ID | M1026 | Name | Privileged Account Management | Description | Limit the usage of local administrator and domain administrator accounts to be used for day-to-day operations that may expose them to potential adversaries. |
---|
ID | M1024 | Name | Restrict Registry Permissions | Description | Ensure proper permissions are set for the Registry to prevent users from modifying keys related to code signing policies. |
---|
ID | M1046 | Name | Boot Integrity | Description | Use of Secure Boot may prevent some implementations of modification to code signing policies. |
---|