T1027.010 Command Obfuscation
Sub-technique of: T1027
High-Level Description
Adversaries may obfuscate content during command execution to impede detection. Command-line obfuscation is a method of making strings and patterns within commands and scripts more difficult to signature and analyze. This type of obfuscation can be included within commands executed by delivered payloads (e.g., Phishing and Drive-by Compromise) or interactively via Command and Scripting Interpreter.
For example, adversaries may abuse syntax that utilizes various symbols and escape characters (such as spacing, ^, +. $, and %) to make commands difficult to analyze while maintaining the same intended functionality. Many languages support built-in obfuscation in the form of base64 or URL encoding. Adversaries may also manually implement command obfuscation via string splitting (“Wor”+“d.Application”), order and casing of characters (rev <<<'dwssap/cte/ tac'), globing (mkdir -p '/tmp/:&$NiA'), as well as various tricks involving passing strings through tokens/environment variables/input streams.
Adversaries may also use tricks such as directory traversals to obfuscate references to the binary being invoked by a command (C:\voi\pcw\..\..\Windows\tei\qs\k\..\..\..\system32\erool\..\wbem\wg\je\..\..\wmic.exe shadowcopy delete).
Tools such as Invoke-Obfuscation and Invoke-DOSfucation have also been used to obfuscate commands.
Kill Chain Phase
- Defense Evasion (TA0005)
Platforms: Linux, macOS, Windows
What to Check
- Identify if Command Obfuscation technique is applicable to target environment
- Check Linux systems for indicators of Command Obfuscation
- Check macOS systems for indicators of Command Obfuscation
- Check Windows systems for indicators of Command Obfuscation
- Verify mitigations are bypassed or absent (2 known mitigations)
- Assess detection coverage (1 detection strategies)
How to Test
Manual Testing
Identify Attack Surface: Determine if the target environment is susceptible to Command Obfuscation by examining the target platforms (Linux, macOS, Windows).
Assess Existing Defenses: Review whether mitigations for T1027.010 are in place. If defenses are absent or misconfigured, this technique may be exploitable.
Execute Test: Use tools and methods described in the MITRE ATT&CK page and external references below.
Note: No Atomic Red Team tests available for this technique. See Atomic Red Team GitHub for updates.
Remediation Guide
M1040 Behavior Prevention on Endpoint
On Windows 10+, enable Attack Surface Reduction (ASR) rules to block execution of potentially obfuscated scripts.
M1049 Antivirus/Antimalware
Consider utilizing the Antimalware Scan Interface (AMSI) on Windows 10+ to analyze commands after being processed/interpreted.
Detection
Detection Strategy for Command Obfuscation
Risk Assessment
| Finding | Severity | Impact |
|---|---|---|
| Command Obfuscation technique applicable | High | Defense Evasion |
CWE Categories
| CWE ID | Title |
|---|---|
| CWE-693 | Protection Mechanism Failure |