Detect Malvertising in Google Chronicle
Adversaries may purchase online advertisements to distribute malware to victims. Ads can be positioned prominently in search results or on popular websites, exploiting user trust in those platforms. Malvertising campaigns frequently spoof legitimate software vendors, tricking users into downloading trojanized installer packages. Because the adversary's infrastructure purchase occurs entirely outside the victim environment, detection must pivot to observable victim-side indicators: browsers spawning unexpected child processes, executable file downloads staged in user-writable directories, and drive-by script execution patterns consistent with clicking a malicious ad.
MITRE ATT&CK
- Tactic
- Resource Development
- Technique
- T1583 Acquire Infrastructure
- Sub-technique
- T1583.008 Malvertising
- Canonical reference
- https://attack.mitre.org/techniques/T1583/008/
YARA-L Detection Query
rule malvertising_browser_spawns_suspicious_child {
meta:
author = "Argus Detection Engineering"
description = "Detects malvertising drive-by execution: browsers spawning LOLBin or interpreter child processes with suspicious command-line indicators — encoded commands, download helpers, silent install flags, or network references."
mitre_attack_tactic = "Resource Development"
mitre_attack_technique = "T1583.008"
severity = "HIGH"
priority = "HIGH"
created = "2026-04-13"
version = "1.0"
events:
$e.metadata.event_type = "PROCESS_LAUNCH"
$e.principal.process.file.full_path = /(?i)(chrome\.exe|msedge\.exe|firefox\.exe|iexplore\.exe|opera\.exe|brave\.exe|safari\.exe)$/
$e.target.process.file.full_path = /(?i)(powershell\.exe|pwsh\.exe|cmd\.exe|mshta\.exe|wscript\.exe|cscript\.exe|rundll32\.exe|regsvr32\.exe|msiexec\.exe|certutil\.exe|bitsadmin\.exe)$/
(
$e.target.process.command_line = /(?i)(\\Downloads\\|\\Temp\\|AppData\\Local\\Temp)/
or $e.target.process.command_line = /(?i)(http:\/\/|https:\/\/|ftp:\/\/)/
or $e.target.process.command_line = /(?i)(-enc|-encodedcommand|\biex\b|downloadstring|downloadfile|webclient|invoke-webrequest)/
or $e.target.process.command_line = /(?i)(-windowstyle\s+hidden|-w\s+hidden|\/quiet|\/silent|\/verysilent)/
)
condition:
$e
} Chronicle YARA-L 2.0 rule detecting T1583.008 malvertising by matching PROCESS_LAUNCH UDM events where the principal (parent) process is a known browser and the target (child) process is a high-risk interpreter or LOLBin. The rule requires at least one additional suspicious command-line indicator (download path, inline URL, encoded-command token, or silent install flag) to reduce noise while maintaining high-fidelity signal for analyst triage.
Data Sources
Required Tables
False Positives & Tuning
- Browser-integrated enterprise management platforms (e.g., Workspace ONE, Intune web portal) that trigger msiexec.exe or powershell.exe from a browser context during device enrolment, including /quiet flags.
- Custom corporate intranet applications that use browser protocol handlers to invoke cmd.exe or powershell.exe scripts stored in the user's AppData directory for local automation tasks.
- Web-based developer tooling (e.g., browser IDEs or CI dashboards) that launch local build scripts via the browser, producing a browser→powershell/cmd chain with network and path indicators in the command line.
Other platforms for T1583.008
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 1Simulate Browser Spawning PowerShell (Malvertising Drive-by Pattern)
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, ParentImage=cmd.exe, CommandLine containing '-WindowStyle Hidden'. Sysmon Event ID 11: File Create for malv-test.txt in Temp. Security Event ID 4688 (if command line auditing enabled). PowerShell ScriptBlock Log Event ID 4104 showing Write-Output command.
- Test 2Stage and Execute Trojanized Installer from Downloads Folder
Expected signal: Sysmon Event ID 11: File Create for 7zip-2400-x64.exe in the Downloads folder. Sysmon Event ID 1: Process Create with Image path inside the Downloads folder — anomalous for any legitimate software. Security Event ID 4688 if command line auditing is enabled.
- Test 3HTA Drive-by Execution Simulating Malvertising Redirect
Expected signal: Sysmon Event ID 1: Process Create for mshta.exe with TargetFilename in Temp path. Sysmon Event ID 11: File Create for hta-atomic.txt. Security Event ID 4688 for mshta.exe execution. If launched from a browser parent, the main detection fires on mshta.exe as a SuspiciousChild with DownloadPath=1.
- Test 4PowerShell Download Cradle Spawned from Browser Context (Simulated Raspberry Robin Pattern)
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe, ParentImage=cmd.exe, CommandLine containing 'Net.WebClient' and 'DownloadString'. Sysmon Event ID 3: Network connection attempt to 127.0.0.1:18080 (connection refused, but event still fires). PowerShell ScriptBlock Log Event ID 4104 showing the download cradle code.
References (7)
- https://attack.mitre.org/techniques/T1583/008/
- https://www.spamhaus.com/resource-center/a-surge-of-malvertising-across-google-ads-is-distributing-dangerous-malware/
- https://labs.guard.io/masquerads-googles-ad-words-massively-abused-by-threat-actors-targeting-organizations-gpus-42ae73ee8a1e
- https://www.ic3.gov/Media/Y2022/PSA221221
- https://www.sentinelone.com/blog/breaking-down-the-seo-poisoning-attack-how-attackers-are-hijacking-search-results/
- https://www.bbc.com/news/technology-12891182
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1583.008/T1583.008.md
Unlock Pro Content
Get the full detection package for T1583.008 including response playbook, investigation guide, and atomic red team tests.