Drive-by Target
Adversaries prepare operational websites to infect systems that visit over the normal course of browsing. This involves staging malicious JavaScript, exploit kit landing pages, browser profiling code (e.g., ScanBox), or trojanized downloads on adversary-controlled or compromised legitimate websites — including watering hole attacks targeting specific communities such as government agencies, industries, or regional groups. Staging methods include injecting malicious scripts into existing web pages, modifying files served from publicly writable cloud storage buckets, and purchasing malvertising space. Because staging occurs entirely on adversary infrastructure, direct detection is not possible from the victim side. Detection strategy focuses on victim-side downstream artifacts: browsers spawning unexpected child processes (exploitation indicator), executable files dropped by browser processes to temp directories, and browser network connections to newly registered or cloud-hosted infrastructure serving executable content.
let BrowserProcesses = dynamic(["chrome.exe", "firefox.exe", "msedge.exe", "iexplore.exe", "brave.exe", "opera.exe", "microsoftedge.exe"]);
let SuspiciousChildProcesses = dynamic(["cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe", "schtasks.exe", "certutil.exe", "bitsadmin.exe", "msiexec.exe", "wmic.exe", "curl.exe", "pcalua.exe", "msbuild.exe"]);
// Sub-query 1: Browser spawning suspicious child processes — strong exploitation indicator
let BrowserExploitSpawn = DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ (BrowserProcesses)
| where FileName in~ (SuspiciousChildProcesses)
| extend RiskScore = case(
FileName in~ ("powershell.exe", "mshta.exe", "wscript.exe", "cscript.exe"), 3,
FileName in~ ("rundll32.exe", "regsvr32.exe", "pcalua.exe", "msbuild.exe"), 2,
FileName in~ ("certutil.exe", "bitsadmin.exe", "schtasks.exe", "wmic.exe", "cmd.exe"), 2,
1)
| extend DetectionSource = "BrowserSpawnedSuspiciousProcess"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, RiskScore, DetectionSource;
// Sub-query 2: Browser dropping executable content to temp or public directories
let BrowserFileDrop = DeviceFileEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ (BrowserProcesses)
| where ActionType == "FileCreated"
| where FolderPath has_any ("\\AppData\\Local\\Temp\\", "\\Windows\\Temp\\", "\\Users\\Public\\")
| where FileName endswith ".exe" or FileName endswith ".dll"
or FileName endswith ".hta" or FileName endswith ".vbs"
or FileName endswith ".ps1" or FileName endswith ".js"
or FileName endswith ".bat" or FileName endswith ".cmd"
or FileName endswith ".scr"
| extend RiskScore = case(
FileName endswith ".exe" or FileName endswith ".dll", 3,
FileName endswith ".hta" or FileName endswith ".vbs" or FileName endswith ".ps1", 3,
FileName endswith ".js" or FileName endswith ".bat" or FileName endswith ".cmd" or FileName endswith ".scr", 2,
1)
| extend DetectionSource = "BrowserDroppedExecutable"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
InitiatingProcessFileName, RiskScore, DetectionSource;
union BrowserExploitSpawn, BrowserFileDrop
| sort by RiskScore desc, Timestamp desc Data Sources
Required Tables
False Positives
- Browser extensions or plugins that legitimately spawn helper processes — e.g., PDF readers (AcroRd32.exe), video codec installers, accessibility tools launched via browser
- Legitimate software update mechanisms triggered through the browser — Chrome or Firefox update pipelines may invoke msiexec.exe or cmd.exe to apply updates
- Developer workflows using browser-based IDEs, build tools, or debugging extensions that spawn local script interpreters or Node.js processes
- Enterprise protocol handlers (custom URI schemes such as myapp://) that allow browsers to launch registered desktop applications or scripts
- Download managers integrated with browsers that save executable files to standard temp directories before user-initiated installation
References (8)
- https://attack.mitre.org/techniques/T1608/004/
- https://cybersecurity.att.com/blogs/labs-research/scanbox-a-reconnaissance-framework-used-on-watering-hole-attacks
- http://arstechnica.com/security/2015/08/newly-discovered-chinese-hacking-group-hacked-100-websites-to-use-as-watering-holes/
- https://web.archive.org/web/20201024230407/https://www.fireeye.com/blog/threat-research/2012/12/council-foreign-relations-water-hole-attack-details.html
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicefileevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1608.004/T1608.004.md
Unlock Pro Content
Get the full detection package for T1608.004 including response playbook, investigation guide, and atomic red team tests.