Mark-of-the-Web Auditing: The Zone.Identifier Stream That Powers SmartScreen and Office Protected View
How the MOTW zone identifier ADS gates SmartScreen and Office Protected View, why attackers strip it, and how to audit MOTW enforcement on Windows.
Almost every Windows defense that fires when a user opens a downloaded file — SmartScreen reputation checks, Office Protected View, macro blocking, the "Do you want to run this?" dialog — depends on a single, invisible piece of metadata: the Mark-of-the-Web (MOTW). It is not a policy, a signature, or a reputation score. It is a tiny NTFS alternate data stream named Zone.Identifier that Windows tags onto files that came from an untrusted source. If that stream is missing, every one of those protections silently steps aside. Understanding — and auditing — where MOTW lives, how it propagates, and how attackers strip it is one of the highest-leverage things a Windows defender can do.
What MOTW actually is
When an application that supports the Attachment Manager API (browsers, mail clients, chat apps, archive tools) writes a file it received from the internet, it attaches an alternate data stream. You can see it on any downloaded file:
Get-Content .\invoice.docx -Stream Zone.Identifier
[ZoneTransfer]
ZoneId=3
ReferrerUrl=https://example.com/
HostUrl=https://example.com/invoice.docx
The critical field is ZoneId. The values map to Internet Explorer security zones that Windows still uses internally: 0 Local Machine, 1 Local Intranet, 2 Trusted Sites, 3 Internet, 4 Restricted Sites. A ZoneId of 3 or 4 is what makes SmartScreen and Office treat the file as suspicious. No stream at all means the file is treated as though it originated locally — fully trusted.
Why it matters: the whole chain hangs off one stream
MOTW is the shared trigger for a surprising number of controls:
- SmartScreen only reputation-checks executables that carry MOTW. Strip the stream and a brand-new malware binary launches with no prompt.
- Office Protected View opens marked documents read-only in a sandbox, and blocks macros from marked files entirely (the "SECURITY RISK — Microsoft has blocked macros" banner). Remove MOTW and macros run on open.
- Windows Script Host and HTA treat marked
.js,.vbs, and.htafiles with extra warnings. - AppLocker/WDAC and archive utilities can key decisions off zone identity.
MOTW is a single point of failure by design: one missing stream disables reputation checks, Protected View, and macro blocking all at once. That is exactly why "MOTW bypass" is a recurring theme in real-world phishing chains.
How attackers strip or dodge MOTW
Threat actors have industrialized MOTW evasion because it converts a blocked payload into a trusted one for free:
- Container formats that don't propagate MOTW. For years, ISO, IMG, and VHD/VHDX files mounted as virtual drives, and the files inside them did not inherit the mark. This drove the shift to ISO-delivered loaders. Microsoft has since closed several of these gaps, but legacy and third-party tools still vary.
- Archive tools that drop the stream. Some third-party extractors did not copy
Zone.Identifierto extracted files. 7-Zip added a propagation option; many older builds and configs still lose it. - Manual removal. A one-liner clears it:
Unblock-Fileor deleting the stream directly withRemove-Item -Stream Zone.Identifier. Malware droppers do the same programmatically after writing to disk. - Non-NTFS volumes. Alternate data streams are an NTFS feature. Files staged on FAT/exFAT USB media or network shares that don't preserve ADS lose the mark in transit.
Auditing MOTW posture with WinSentinel
MOTW is a per-machine, host-level control, so this is squarely in the free tier — WinSentinel runs all 64 modules with no limits on a single machine. The relevant checks look at whether the enforcement plumbing is intact rather than scanning every file on disk:
- SmartScreen enforcement: confirm
SmartScreenEnabledand the Explorer/Edge SmartScreen policies are set to Warn or Block, not Off, so MOTW-tagged executables are actually checked. - Office macro policy: verify
BlockContentExecutionFromInternet(VBA macro blocking for files from the internet) and Protected View settings are enabled and not overridden by trusted-location sprawl. - Attachment Manager policy: check that
SaveZoneInformationhas not been disabled — a Group Policy setting that, when misconfigured, tells Windows to stop writing MOTW in the first place. - Vulnerable-driver and container hygiene: flag mount tooling and legacy handlers that historically failed to propagate the mark.
A quick manual spot-check on any endpoint tells you whether marking is even happening:
# Find recently downloaded files still carrying MOTW
Get-ChildItem $env:USERPROFILE\Downloads -Recurse -File |
ForEach-Object {
$z = Get-Content $_.FullName -Stream Zone.Identifier -ErrorAction SilentlyContinue
if ($z) { [pscustomobject]@{ File=$_.Name; Zone=($z -match 'ZoneId=(\d)' | Out-Null; $Matches[1]) } }
}
If freshly downloaded files show no Zone.Identifier at all, marking is broken somewhere in the chain — a browser policy, an extractor, or a disabled SaveZoneInformation — and that is a finding worth chasing.
Hardening recommendations
- Leave SmartScreen set to Warn/Block for both Explorer and the browser; never disable it fleet-wide for convenience.
- Enable "Block macros from running in Office files from the Internet" and resist the urge to whitelist broad trusted locations that neutralize it.
- Confirm
SaveZoneInformationis not set to "Do not preserve" in the Attachment Manager GPO. - Configure archive tools to propagate MOTW to extracted files, and treat mounted ISO/VHD content as untrusted.
- Alert on bulk stream removal — scripted
Unblock-Fileor ADS deletion across many files is a strong tampering signal.
Fleet-scale drift detection
On a single machine you fix these settings once. Across an org, the harder problem is that they drift — a helpdesk exclusion here, a disabled SmartScreen policy there, a new imaging profile that ships with macro blocking off. WinSentinel Pro rolls these host-level MOTW findings up across the fleet from a central node, so you can rank machines by posture, catch the moment a node regresses from "marking enforced" to "marking disabled," and get a compliance view instead of logging into 100 endpoints. The audit runs locally on every machine; Pro is what turns those local results into fleet-wide visibility and drift alerts.
MOTW is small, quiet, and load-bearing. Auditing that the mark is written, preserved, and honored is one of the cheapest ways to keep the entire "opened a bad download" defense chain standing.