Detect Steganography in Elastic Security
Adversaries may use steganography techniques in order to prevent the detection of hidden information. Steganographic techniques can be used to hide data in digital media such as images, audio tracks, video clips, or text files. Adversaries commonly hide malicious payloads within PNG, BMP, JPG, and GIF files, often extracting PE executables or shellcode at runtime using LSB (Least Significant Bit) manipulation or custom XOR-based extraction. Threat actors including APT37, APT29, Andariel, Tropic Trooper, BRONZE BUTLER, and MuddyWater have used steganography to hide C2 configurations, shellcode, and full malware payloads within seemingly benign images.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1027 Obfuscated Files or Information
- Sub-technique
- T1027.003 Steganography
- Canonical reference
- https://attack.mitre.org/techniques/T1027/003/
Elastic Detection Query
any where
(
event.category == "process" and event.type == "start" and
(
process.command_line : ("*invoke-psimage*", "*steghide*", "*openstego*", "*outguess*", "*stegdetect*")
or
(
process.command_line : ("*.png*", "*.jpg*", "*.jpeg*", "*.bmp*", "*.gif*", "*.tiff*")
and process.command_line : ("*extract*", "*decode*", "*lsb*", "*steg*", "*hidden*", "*payload*")
)
)
)
or
(
event.category == "file" and event.type == "creation"
and file.name like~ ("*.exe", "*.dll")
and process.name like~ ("chrome.exe", "msedge.exe", "iexplore.exe", "firefox.exe", "explorer.exe")
and file.path : ("*\\Temp\\*", "*\\Downloads\\*", "*\\Pictures\\*")
) Detects steganography tool execution (invoke-psimage, steghide, openstego, outguess, stegdetect) and suspicious image-based payload extraction via process command-line inspection using Elastic ECS fields. Also identifies PE/DLL files written to user-accessible directories by browser processes, which may indicate runtime extraction of payloads hidden in downloaded images.
Data Sources
Required Tables
False Positives & Tuning
- Security researchers, CTF participants, or penetration testers legitimately running steghide, stegdetect, or outguess on monitored endpoints during authorized engagements
- Digital forensics investigators using image extraction tooling (e.g., Autopsy plugins, FTK components) that invoke LSB or decode operations against image files as part of authorized case analysis
- Legitimate enterprise software installers downloaded by a browser to the Downloads or Temp directory that match the PE file drop pattern but are vendor-signed and expected
Other platforms for T1027.003
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Hide and Extract Payload with Invoke-PSImage
Expected signal: Sysmon Event ID 3: Network connection to raw.githubusercontent.com. Sysmon Event ID 11: stego_test.png created in %TEMP%. PowerShell ScriptBlock Log Event ID 4104: Invoke-PSImage commands and the embedded script. The PNG will have slightly modified pixel values to carry the hidden payload.
- Test 2Embed Secret Message in Image using steghide
Expected signal: Sysmon Event ID 1: steghide.exe process creation with 'embed' then 'extract' arguments. Sysmon Event ID 11: stego_output.jpg and extracted_payload.txt created in %TEMP%. The steghide tool name will appear in process command lines.
- Test 3Simulate C2 Configuration Retrieval via Steganographic Image
Expected signal: Sysmon Event ID 1: powershell.exe with Invoke-WebRequest to external URL. Sysmon Event ID 3: Network connection to microsoft.com port 443. PowerShell ScriptBlock Log Event ID 4104: the extraction code using bitwise AND on image bytes.
- Test 4Detect High-Entropy Data in Image with binwalk
Expected signal: Process execution for dd and binwalk commands. Auditd execve records for both commands. The binwalk output will show signatures of embedded data within the image file.
References (5)
- https://attack.mitre.org/techniques/T1027/003/
- https://en.wikipedia.org/wiki/Duqu
- https://securingtomorrow.mcafee.com/mcafee-labs/malicious-document-targets-pyeongchang-olympics/
- https://github.com/peewpw/Invoke-PSImage
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1027.003/T1027.003.md
Unlock Pro Content
Get the full detection package for T1027.003 including response playbook, investigation guide, and atomic red team tests.