T1583.008

Malvertising

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.

Microsoft Sentinel / Defender
kusto
// Detect browsers spawning suspicious child processes — primary indicator of malvertising drive-by execution
let Browsers = dynamic(["chrome.exe", "msedge.exe", "firefox.exe", "iexplore.exe", "opera.exe", "brave.exe", "safari.exe"]);
let SuspiciousChildren = dynamic(["powershell.exe", "pwsh.exe", "cmd.exe", "mshta.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "regsvr32.exe", "msiexec.exe", "certutil.exe", "bitsadmin.exe"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ (Browsers)
| where FileName in~ (SuspiciousChildren)
| extend DownloadPath = iff(FolderPath has_any ("\\Downloads\\", "\\Temp\\", "\\AppData\\Local\\Temp\\"), 1, 0)
| extend NetworkRef = iff(ProcessCommandLine has_any ("http://", "https://", "ftp://"), 1, 0)
| extend EncodedOrDL = iff(ProcessCommandLine has_any ("-enc", "-EncodedCommand", "iex", "DownloadString", "DownloadFile", "WebClient", "Invoke-WebRequest"), 1, 0)
| extend HiddenOrSilent = iff(ProcessCommandLine has_any ("-WindowStyle Hidden", "-w hidden", "/quiet", "/q ", "/silent", "/verysilent"), 1, 0)
| extend SuspicionScore = DownloadPath + NetworkRef + EncodedOrDL + HiddenOrSilent + 1
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         FolderPath, DownloadPath, NetworkRef, EncodedOrDL, HiddenOrSilent, SuspicionScore,
         InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by SuspicionScore desc, Timestamp desc
high severity medium confidence

Data Sources

Process: Process Creation Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • 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

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