HTML Smuggling
Adversaries may smuggle data and files past content filters by hiding malicious payloads inside of seemingly benign HTML files. HTML documents can store large binary objects known as JavaScript Blobs that can later be constructed into file-like objects. Data may also be stored in Data URLs, enabling embedding media type or MIME files inline of HTML documents. HTML5 introduced a download attribute that may be used to initiate file downloads. Adversaries deliver payloads that bypass security controls through HTML Smuggling by abusing JavaScript Blobs and/or HTML5 download attributes. APT29 (NOBELIUM) used HTML smuggling to deliver ISO files embedded in HTML attachments (EnvyScout). QakBot was delivered in ZIP files via HTML smuggling. This technique bypasses web content filters because the HTML file itself contains only text/html MIME content.
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType == "FileCreated"
| where FileName endswith ".iso" or FileName endswith ".img" or FileName endswith ".zip"
or FileName endswith ".exe" or FileName endswith ".js" or FileName endswith ".hta"
or FileName endswith ".lnk" or FileName endswith ".bat" or FileName endswith ".vbs"
| where InitiatingProcessFileName in~ ("msedge.exe", "chrome.exe", "firefox.exe",
"iexplore.exe", "brave.exe", "opera.exe")
| where FolderPath has_any ("\\Downloads\\", "\\Temp\\", "\\AppData\\")
| extend IsISO = FileName endswith ".iso" or FileName endswith ".img"
| extend IsArchive = FileName endswith ".zip" or FileName endswith ".rar" or FileName endswith ".7z"
| extend IsExecutable = FileName endswith ".exe" or FileName endswith ".hta" or FileName endswith ".js"
or FileName endswith ".bat" or FileName endswith ".vbs" or FileName endswith ".lnk"
| where IsISO or IsExecutable
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
InitiatingProcessFileName, InitiatingProcessCommandLine,
IsISO, IsArchive, IsExecutable
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate ISO downloads from software vendor websites (Microsoft, VMware, Linux distributions) via browsers
- Users intentionally downloading executable installers from known-good vendor sites
- Developers downloading JavaScript bundles or build artifacts that happen to use download attribute
- Browser extensions or web applications that legitimately generate and download files via JavaScript Blob API
References (6)
- https://attack.mitre.org/techniques/T1027/006/
- https://outflank.nl/blog/2018/08/14/html-smuggling-explained/
- https://www.microsoft.com/security/blog/2021/05/27/new-sophisticated-email-based-attack-from-nobelium/
- https://www.menlosecurity.com/blog/new-attack-alert-duri
- https://www.nccgroup.com/us/research-blog/smuggling-hta-files-in-internet-exploreredge/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1027.006/T1027.006.md
Unlock Pro Content
Get the full detection package for T1027.006 including response playbook, investigation guide, and atomic red team tests.