Detect Steganography in Splunk
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/
SPL Detection Query
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
| eval cmdline=lower(CommandLine)
| eval IsStegoTool=if(match(cmdline, "(invoke-psimage|steghide|openstego|outguess|stegdetect)"), 1, 0)
| eval IsImageExec=if(match(cmdline, "(\.png|\.jpg|\.jpeg|\.bmp|\.gif).*\-exec|exec.*(\.png|\.jpg|\.bmp)"), 1, 0)
| eval IsImageExtract=if(match(cmdline, "(extract|lsb|decode).*(\.png|\.jpg|\.bmp)"), 1, 0)
| where IsStegoTool=1 OR IsImageExec=1 OR IsImageExtract=1
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, IsStegoTool, IsImageExec, IsImageExtract
| sort - _time
| append [
search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
(TargetFilename="*\\Pictures\\*.exe" OR TargetFilename="*\\Downloads\\*.exe")
(Image="*\\chrome.exe" OR Image="*\\msedge.exe" OR Image="*\\iexplore.exe" OR Image="*\\firefox.exe")
| eval DropType="BrowserExeDrop"
| table _time, host, User, TargetFilename, Image, DropType
] Detects steganography tool execution and suspicious patterns where image file paths appear in command lines alongside execution or extraction keywords. The appended search identifies executables dropped to Pictures/Downloads directories by browsers — a common indicator when a user downloads a steganographic image that extracts a payload.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Legitimate forensic software (Autopsy, Encase) running steganography detection modules
- Security awareness training platforms that simulate steganographic attack downloads
- Software installers stored in Downloads or Pictures by legitimate download managers
- Development environments testing image processing libraries that include steganography functions
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.