The malware itself or built-in system utilities can do the work. MITRE tracks it as T1140 under the Stealth tactic.
How it works
Attackers often hide files or data to keep them from analysis. Before that content can be used, it has to be turned back into a usable form. This can be done by the malware itself or by utilities that are already present on the system.
MITRE gives two examples: using a built-in certificate utility to decode a remote access tool hidden inside a certificate file, and using standard Windows commands to reassemble fragments of a file into a malicious payload.
Sometimes the user has to take part. They may need to open a file or type a password for a protected archive that the attacker supplied.
A real example
Procedure examples listed by MITRE ATT&CK:
- ABK can decrypt AES encrypted payloads.
- AppleSeed can decode its payload before it runs.
- Avaddon has decrypted encrypted strings.
- Astaroth uses a fromCharCode() deobfuscation method to avoid writing execution commands in plain form and to hide its code.
- An APT28 macro uses the certutil -decode command to decode a text file that stores a base64 encoded payload (MITRE ATT&CK lists APT28 as using this technique).
How to detect
-
Built-in tools decoding content
Watch for system utilities and script tools being used to decode, reassemble, decompress or decrypt files, especially soon after a file was staged or downloaded.
-
Decoding followed by execution
Decoding tools are often chained with script interpreters or with further execution of the unpacked payload, so look at the sequence of processes.
-
Cross-platform tools
On Linux and macOS, native encoding, compression and encryption utilities can play the same role, often after a download.
-
Detection strategy MITRE lists
DET0275, Detect Adversary Deobfuscation or Decoding of Files and Payloads.
How to defend
-
Accept limited prevention
MITRE states this technique cannot easily be mitigated with preventive controls because it abuses normal system features.
-
Focus on detection
Invest in monitoring of process activity and file changes so that decoding steps are noticed and reviewed.
Frequently Asked Questions
What is Deobfuscate/Decode Files or Information (T1140)?
It is a Stealth technique where attackers unpack, decode or decrypt content they had hidden earlier, so it can be used on the target system. The malware itself or utilities already present on the system can do the work.
Why do attackers hide files and then decode them?
Attackers often hide files or data to keep them from analysis. Before that content can be used, it has to be turned back into a usable form. MITRE gives examples such as a built-in certificate utility decoding a remote access tool hidden inside a certificate file.
Does decoding need help from the user?
Sometimes. The user may need to open a file or type a password for a protected archive that the attacker supplied. In other cases the malware or built-in system tools decode the content without any user action.
How can I detect this technique?
Watch for system utilities and script tools being used to decode, reassemble, decompress or decrypt files, especially soon after a file was staged or downloaded. Decoding is often chained with script interpreters, so look at the sequence of processes.
Can T1140 be prevented?
Not easily. MITRE states this technique cannot easily be mitigated with preventive controls because it abuses normal system features. The advice is to focus on detection by monitoring process activity and file changes so decoding steps are noticed and reviewed.
