T1583.008 Splunk · SPL

Detect Malvertising in Splunk

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/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
  (ParentImage="*\\chrome.exe" OR ParentImage="*\\msedge.exe" OR ParentImage="*\\firefox.exe" OR
   ParentImage="*\\iexplore.exe" OR ParentImage="*\\opera.exe" OR ParentImage="*\\brave.exe")
  (Image="*\\powershell.exe" OR Image="*\\pwsh.exe" OR Image="*\\cmd.exe" OR
   Image="*\\mshta.exe" OR Image="*\\wscript.exe" OR Image="*\\cscript.exe" OR
   Image="*\\rundll32.exe" OR Image="*\\regsvr32.exe" OR Image="*\\msiexec.exe" OR
   Image="*\\certutil.exe" OR Image="*\\bitsadmin.exe")
| eval DownloadPath=if(match(CurrentDirectory, "(\\\\Downloads\\\\|\\\\Temp\\\\|AppData\\\\Local\\\\Temp)"), 1, 0)
| eval NetworkRef=if(match(CommandLine, "(http://|https://|ftp://)"), 1, 0)
| eval EncodedOrDL=if(match(lower(CommandLine), "(-enc|-encodedcommand|iex|downloadstring|downloadfile|webclient|invoke-webrequest)"), 1, 0)
| eval HiddenOrSilent=if(match(lower(CommandLine), "(-windowstyle\s+hidden|-w\s+hidden|/quiet|/silent|/verysilent)"), 1, 0)
| eval SuspicionScore=DownloadPath + NetworkRef + EncodedOrDL + HiddenOrSilent + 1
| table _time, host, User, Image, CommandLine, CurrentDirectory, ParentImage, ParentCommandLine,
        DownloadPath, NetworkRef, EncodedOrDL, HiddenOrSilent, SuspicionScore
| sort - SuspicionScore, - _time
high severity medium confidence

Detects browsers spawning suspicious child processes using Sysmon Event ID 1 (Process Creation). Monitors Chrome, Edge, Firefox, Internet Explorer, Opera, and Brave as parent processes spawning known LOLBin and script interpreter executables. Evaluates the spawned process command line for four categories of malicious behavior: download path execution, network URL references, encoded/download cradle patterns, and hidden/silent execution flags. The cumulative suspicion score helps analysts prioritize — a score of 1 is a bare browser-spawn anomaly, while 3+ indicates high-confidence malvertising payload execution.

Data Sources

Process: Process CreationSysmon Event ID 1

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • Browser-based enterprise software portals that use ClickOnce deployment, legitimately spawning msiexec.exe or setup.exe from the browser for internal application installation
  • IT administrators downloading and immediately running legitimate signed tools from vendor sites (e.g., Sysinternals, vendor agent MSIs, driver installers)
  • Software update helpers where the browser opens a downloaded updater that spawns cmd.exe or PowerShell as part of a legitimate update workflow
  • Developer environments where VS Code, IntelliJ, or similar IDEs integrate browser-based workflows that spawn terminal processes
  • Browser PDF plugins or media extensions that spawn helper processes from the user's Downloads or Temp folder during document rendering
Download portable Sigma rule (.yml)

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Unlock Pro Content

Get the full detection package for T1583.008 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections