Encoded Executable Stored in the Registry
This rule detects registry write modifications hiding encoded portable executables, indicative of adversary defense evasion by avoiding storing malicious content directly on disk.
This detection identifies Windows Registry modifications used to conceal encoded portable executables, a tactic employed by adversaries to evade traditional disk-based detection mechanisms. The rule focuses on detecting registry entries with data strings that match known encoded executable patterns. This technique allows attackers to store malicious code within the registry, making it more difficult to detect using standard file-based scanning methods. The rule is designed to work with Elastic Defend, but also supports data from third-party EDR solutions, including CrowdStrike, Microsoft Defender XDR, and SentinelOne. The detection logic focuses on identifying registry entries with data resembling encoded executables.
Attack Chain
- An attacker gains initial access to the system (e.g., through compromised credentials or exploiting a vulnerability).
- The attacker uses a command-line tool, such as PowerShell or cmd.exe, to interact with the registry.
- The attacker encodes a malicious executable using tools like
certutilor custom encoding scripts. - The attacker creates or modifies a registry key using
reg.exeor PowerShell’sSet-ItemPropertycmdlet. - The encoded executable is written to the registry key’s data value. The data string often starts with “TVqQAAMAAAAEAAAA*”.
- The attacker uses another script or command to decode the executable from the registry.
- The decoded executable is then executed in memory or written to disk for execution.
- The attacker achieves their final objective, such as establishing persistence, escalating privileges, or deploying ransomware.
Impact
Successful exploitation allows attackers to evade traditional disk-based security measures, enabling them to execute malicious code undetected. Attackers can use this technique to establish persistence, escalate privileges, or deploy malware, including ransomware. The rule helps defenders identify systems where this defense evasion technique is being employed.
Recommendation
- Deploy the Sigma rules provided in this brief to your SIEM to detect encoded executables stored in the registry.
- Enable Sysmon registry event logging to provide the necessary data for the provided Sigma rules.
- Investigate any alerts triggered by the Sigma rules to determine if the registry modification is malicious.
- Use endpoint detection and response (EDR) tools to further analyze suspicious processes associated with the registry modifications.
- Implement application control policies to prevent the execution of unauthorized executables, even if they are decoded from the registry.
Detection coverage 2
Encoded Executable Stored in Registry
mediumDetects registry modifications with encoded executable content, indicating potential defense evasion.
Suspicious Registry Modification Containing Base64 Encoded Data
highDetects suspicious registry modifications containing Base64 encoded data, potentially used to hide malicious scripts or executables.
Detection queries are kept inside the platform. Get full rules →
Indicators of compromise
1
registry
| Type | Value |
|---|---|
| registry | TVqQAAMAAAAEAAAA* |