Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may encrypt or encode files to obfuscate strings, bytes, and other specific patterns to impede detection.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 101% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 92% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 20% | 0% |
> Sub-technique of: T1027
Adversaries may encrypt or encode files to obfuscate strings, bytes, and other specific patterns to impede detection. Encrypting and/or encoding file content aims to conceal malicious artifacts within a file used in an intrusion. Many other techniques, such as Software Packing, Steganography, and Embedded Payloads, share this same broad objective. Encrypting and/or encoding files could lead to a lapse in detection of static signatures, only for this malicious content to be revealed (i.e., Deobfuscate/Decode Files or Information) at the time of execution/use.
This type of file obfuscation can be applied to many file artifacts present on victim hosts, such as malware log/configuration and payload files. Files can be encrypted with a hardcoded or user-supplied key, as well as otherwise obfuscated using standard encoding schemes such as Base64.
The entire content of a file may be obfuscated, or just specific functions or values (such as C2 addresses). Encryption and encoding may also be applied in redundant layers for additional protection.
For example, adversaries may abuse password-protected Word documents or self-extracting (SFX) archives as a method of encrypting/encoding a file such as a Phishing payload. These files typically function by attaching the intended archived content to a decompressor stub that is executed when the file is invoked (e.g., User Execution).
Adversaries may also abuse file-specific as well as custom encoding schemes. For example, Byte Order Mark (BOM) headers in text files may be abused to manipulate and obfuscate file content until Command and Scripting Interpreter execution.
Platforms: Linux, macOS, Windows
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Decode the eicar value, and write it to file, for AV/EDR to try to catch.
Supported Platforms: windows, macos, linux
powershell$encodedString = "WDVPIVAlQEFQWzRcUFpYNTQoUF4pN0NDKTd9JEVJQ0FSLVNUQU5EQVJELUFOVElWSVJVUy1URVNULUZJTEUhJEgrSCo=" $bytes = [System.Convert]::FromBase64String($encodedString) $decodedString = [System.Text.Encoding]::UTF8.GetString($bytes) #write the decoded eicar string to file $decodedString | Out-File $env:temp\T1027.013_decodedEicar.txt
Decrypt the eicar value, and write it to file, for AV/EDR to try to catch.
Supported Platforms: windows, macos, linux
powershell$encryptedString = "76492d1116743f0423413b16050a5345MgB8AGkASwA0AHMAbwBXAFoAagBkAFoATABXAGIAdAA5AFcAWAB1AFMANABVAEEAPQA9AHwAZQBjAGMANgAwADQAZAA0AGQAMQAwADUAYgA4ADAAMgBmADkAZgBjADEANQBjAGMANQBiAGMANwA2AGYANQBmADUANABhAGIAYgAyAGMANQA1AGQAMgA5ADEANABkADUAMgBiAGMANgA2AGMAMAAxADUAZABjADAAOABjAGIANAA1ADUANwBjADcAZQBlAGQAYgAxADEAOQA4AGIAMwAwADMANwAwADAANQA2ADQAOAA4ADkAZgA4ADMAZQA4ADgAOQBiAGEAMAA2ADMAMQAyADYAMwBiAGUAMAAxADgANAA0ADYAOAAxADQANQAwAGUANwBkADkANABjADcANQAxADgAYQA2ADMANQA4AGIAYgA1ADkANQAzAGIAMwAxADYAOAAwADQAMgBmADcAZQBjADYANQA5AGIANwBkADUAOAAyAGEAMgBiADEAMQAzAGQANABkADkAZgA3ADMAMABiADgAOQAxADAANAA4ADcAOQA5ADEAYQA1ADYAZAAzADQANwA3AGYANgAyADcAMAAwADEAMQA4ADEAZgA5ADUAYgBmAGYANQA3ADQAZQA4AGUAMAAxADUANwAwAGQANABiADMAMwA2ADgANwA0AGIANwAyADMAMQBhADkAZABhADEANQAzADQAMgAzADEANwAxADAAZgAxADkAYQA1ADEAMQA=" $key = [byte]1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32 $decrypt = ConvertTo-SecureString -String $encryptedString -Key $key $decryptedString = [Runtime.InteropServices.Marshal]::PtrToStringBSTR([Runtime.InteropServices.Marshal]::SecureStringToBSTR($decrypt)) #Write the decrypted eicar string to a file $decryptedString | Out-File $env:temp\T1027.013_decryptedEicar.txt
Extracts and executes a script from a password-protected ZIP archive. This technique is commonly used by malware families like Emotet and QBot to deliver payloads via email attachments where the password is provided in the message body. The encrypted ZIP evades static file analysis until extracted at runtime. Upon successful execution, displays confirmation and system information.
Supported Platforms: linux, macos
bashecho '#!/bin/bash' > /tmp/art_payload.sh echo 'echo "T1027.013: Payload extracted from encrypted ZIP"' >> /tmp/art_payload.sh echo 'echo "Hostname: $(hostname)"' >> /tmp/art_payload.sh echo 'echo "User: $(whoami)"' >> /tmp/art_payload.sh echo 'uname -a' >> /tmp/art_payload.sh cd /tmp && zip -P "#{zip_password}" art_encrypted.zip art_payload.sh rm /tmp/art_payload.sh echo "Encrypted ZIP created. Extracting with password..." unzip -P "#{zip_password}" -o /tmp/art_encrypted.zip -d /tmp/ echo "Executing extracted payload:" bash /tmp/art_payload.sh
Dependencies:
If Atomic Red Team tests are not applicable, manually verify the technique by:
Anti-virus can be used to automatically detect and quarantine suspicious files, including those with high entropy measurements or with otherwise potentially malicious signs of obfuscation.
On Windows 10+, enable Attack Surface Reduction (ASR) rules to block execution of potentially obfuscated scripts.
Security tools should be configured to analyze the encoding properties of files and detect anomalies that deviate from standard encoding practices.
| Finding | Severity | Impact | | ------------------------------------------- | -------- | --------------- | | Encrypted/Encoded File technique applicable | High | Defense Evasion |
| CWE ID | Title | | ------- | ---------------------------- | | CWE-693 | Protection Mechanism Failure |
Other measured skills in the registry, with their headline benchmark lift.