Detect Mark-of-the-Web Bypass in IBM QRadar
Adversaries abuse container file formats such as ISO disk images, VHD/VHDX virtual hard disks, and compressed archives (ZIP, RAR, 7z, ARJ) to deliver malicious payloads that bypass Mark-of-the-Web (MOTW) protections. When a container file is downloaded from the Internet, Windows tags it with a Zone.Identifier NTFS Alternate Data Stream (ZoneId=3), but files extracted or mounted from containers typically do not inherit this tag because MOTW is an NTFS feature and many container formats do not support NTFS ADS. This allows embedded executables, scripts, and LNK files to bypass Protected View in Microsoft Office, Windows Defender SmartScreen warnings, and other MOTW-dependent security controls. Adversaries also directly manipulate or delete the Zone.Identifier ADS from already-downloaded files (Amadey sets ZoneId=0; attackers use streams.exe or PowerShell Remove-Item -Stream). This technique has been widely adopted by TA505 (ISO/LNK chains), QakBot (ISO packaging), APT29 (ISO/VHDX embedded in HTML), and APT38 (ISO/VHD delivery).
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1553 Subvert Trust Controls
- Sub-technique
- T1553.005 Mark-of-the-Web Bypass
- Canonical reference
- https://attack.mitre.org/techniques/T1553/005/
QRadar Detection Query
-- Branch 1: Zone.Identifier ADS Deletion (Sysmon EventID 15 = FileCreateStreamHash, or Security 4663)
SELECT
DATEFORMAT(devicetime, 'yyyy-MM-dd HH:mm:ss') AS event_time,
logsourcename(logsourceid) AS log_source,
sourceip,
username,
"TargetFilename",
"Image",
"CommandLine",
'Zone_Identifier_ADS_Deleted' AS detection_type
FROM events
WHERE LOGSOURCETYPEID = 119 -- Microsoft Windows Security Event Log (Sysmon via WEC)
AND "EventID" = '15'
AND "TargetFilename" LIKE '%:Zone.Identifier'
AND devicetime > NOW() - 86400000
UNION ALL
-- Branch 2: ADS Manipulation Tools
SELECT
DATEFORMAT(devicetime, 'yyyy-MM-dd HH:mm:ss') AS event_time,
logsourcename(logsourceid) AS log_source,
sourceip,
username,
NULL AS "TargetFilename",
"Image",
"CommandLine",
'ADS_Manipulation_Tool' AS detection_type
FROM events
WHERE LOGSOURCETYPEID = 119
AND "EventID" = '1'
AND (
LOWER("Image") LIKE '%streams.exe'
OR LOWER("Image") LIKE '%streams64.exe'
OR (
(LOWER("Image") LIKE '%powershell.exe' OR LOWER("Image") LIKE '%pwsh.exe')
AND LOWER("CommandLine") LIKE '%zone.identifier%'
AND (
LOWER("CommandLine") LIKE '%remove-item%'
OR LOWER("CommandLine") LIKE '%-stream%'
OR LOWER("CommandLine") LIKE '%clear-content%'
OR LOWER("CommandLine") LIKE '%set-content%'
)
)
OR (
LOWER("Image") LIKE '%cmd.exe'
AND LOWER("CommandLine") LIKE '%zone.identifier%'
)
)
AND devicetime > NOW() - 86400000
UNION ALL
-- Branch 3: PowerShell Disk Image Mount
SELECT
DATEFORMAT(devicetime, 'yyyy-MM-dd HH:mm:ss') AS event_time,
logsourcename(logsourceid) AS log_source,
sourceip,
username,
NULL AS "TargetFilename",
"Image",
"CommandLine",
'DiskImage_Mount_PowerShell' AS detection_type
FROM events
WHERE LOGSOURCETYPEID = 119
AND "EventID" = '1'
AND (LOWER("Image") LIKE '%powershell.exe' OR LOWER("Image") LIKE '%pwsh.exe')
AND (
LOWER("CommandLine") LIKE '%mount-diskimage%'
OR LOWER("CommandLine") LIKE '%mount-vhd%'
OR (
(
LOWER("CommandLine") LIKE '%.iso%'
OR LOWER("CommandLine") LIKE '%.vhd%'
OR LOWER("CommandLine") LIKE '%.vhdx%'
OR LOWER("CommandLine") LIKE '%.img%'
)
AND (
LOWER("CommandLine") LIKE '%mount%'
OR LOWER("CommandLine") LIKE '%attach%'
OR LOWER("CommandLine") LIKE '%diskpart%'
)
)
)
AND devicetime > NOW() - 86400000
UNION ALL
-- Branch 4: Execution from Mounted Volume (non-C: drive via explorer/cmd)
SELECT
DATEFORMAT(devicetime, 'yyyy-MM-dd HH:mm:ss') AS event_time,
logsourcename(logsourceid) AS log_source,
sourceip,
username,
NULL AS "TargetFilename",
"Image",
"CommandLine",
'Exec_From_Mounted_Volume' AS detection_type
FROM events
WHERE LOGSOURCETYPEID = 119
AND "EventID" = '1'
AND REGEXP("Image", '^[D-Zd-z]:\\\\.*\\.(exe|dll|lnk|js|vbs|hta|bat|cmd|ps1|msi)$')
AND (
LOWER("ParentImage") LIKE '%explorer.exe'
OR LOWER("ParentImage") LIKE '%cmd.exe'
)
AND LOWER("Image") NOT LIKE '%program files%'
AND LOWER("Image") NOT LIKE '%games%'
AND LOWER("Image") NOT LIKE '%steam%'
AND devicetime > NOW() - 86400000
ORDER BY event_time DESC Detects T1553.005 MOTW bypass techniques in QRadar AQL covering Zone.Identifier ADS deletion (Sysmon Event 15), ADS manipulation tools, PowerShell disk image mounting, and execution from non-system mounted volumes (Sysmon Event 1).
Data Sources
Required Tables
False Positives & Tuning
- IT automation scripts mounting ISOs for patch management (SCCM, Ansible, PDQ Deploy)
- Sysinternals Streams.exe used legitimately by administrators to audit NTFS ADS
- Portable software distributions running from secondary drives or USB volumes
- Security tools or EDR products that interact with Zone.Identifier during file scanning
Other platforms for T1553.005
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 1Mount ISO File and Execute Payload Without MOTW
Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing 'Mount-DiskImage' and the ISO path. System Event ID 6416 (Kernel-PnP): new virtual volume recognized. Sysmon Event ID 1: cmd.exe executing from a non-C: drive letter spawned by powershell.exe. Sysmon Event ID 11: motw-result.txt file creation in %TEMP%. Critically — no Sysmon Event ID 15 for Zone.Identifier on payload.bat inside the ISO, confirming MOTW bypass.
- Test 2Strip Zone.Identifier ADS via PowerShell Remove-Item -Stream
Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing 'Zone.Identifier' and 'Remove-Item'. Sysmon Event ID 15 (FileCreateStreamHash): fires during the setup phase when Zone.Identifier is written to the file. DeviceFileEvents (MDE) ActionType=FileDeleted targeting the Zone.Identifier stream. Windows Security Event ID 4663 (if object access auditing enabled): DELETE access to the file's ADS.
- Test 3Modify Zone.Identifier to ZoneId=0 (Amadey Technique)
Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing 'Zone.Identifier' and 'Set-Content'. Sysmon Event ID 15 (FileCreateStreamHash): fires twice — once for ZoneId=3 creation and once for the ZoneId=0 overwrite, producing different hash values for the stream content. DeviceFileEvents ActionType=FileModified for the test file. Key forensic indicator: Sysmon Event ID 15 with a hash value matching the ZoneId=0 template string '[ZoneTransfer]\r\nZoneId=0'.
- Test 4Delete Zone.Identifier Using Sysinternals Streams.exe
Expected signal: Sysmon Event ID 1: powershell.exe with Invoke-WebRequest downloading Streams.zip. Sysmon Event ID 3: network connection to download.sysinternals.com. Sysmon Event ID 11: Streams.zip and extracted files created in %TEMP%. Sysmon Event ID 1: streams64.exe process creation with CommandLine containing '-d' and the target file path. DeviceFileEvents: file modification event as Zone.Identifier ADS is deleted from the test file.
References (10)
- https://attack.mitre.org/techniques/T1553/005/
- https://web.archive.org/web/20201203131725/https://christiaanbeek.medium.com/investigating-the-use-of-vhd-files-by-cybercriminals-3f1f08304316
- https://outflank.nl/blog/2020/03/30/mark-of-the-web-from-a-red-teams-perspective/
- https://www.intezer.com/blog/research/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/
- https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/6e3f7352-d11c-4d76-8c39-2516a9df36e8
- https://gist.github.com/wdormann/fca29e0dcda8b5c0472e73e10c78c3e7
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1553.005/T1553.005.md
- https://learn.microsoft.com/en-us/windows/win32/fileio/file-streams
- https://docs.microsoft.com/en-us/sysinternals/downloads/streams
- https://github.com/SwiftOnSecurity/sysmon-config
Unlock Pro Content
Get the full detection package for T1553.005 including response playbook, investigation guide, and atomic red team tests.