Skip to main content
T1189Initial Accessmedium difficulty

Drive-by Compromise

Drive-by Compromise (T1189) is initial access with no click on anything obviously malicious: a user visits a legitimate but compromised site, or one boosted by SEO poisoning, and a script fingerprints the browser before serving an exploit or a fake update. The tell is what the browser process does seconds later: spawning a script host or fetching a payload it never should.

Practice detecting Drive-by Compromise on realistic SIEM, XDR alerts in SOCSimulator Operations.

SIEMXDR

What is Drive-by Compromise?

Drive-by Compromise is documented as technique T1189 in MITRE ATT&CK® v19.1 under the Initial Access tactic. Detection requires visibility into SIEM, XDR telemetry.

The chain starts with a page the victim trusts: a legitimate site that got compromised, one boosted to the top of search results through SEO poisoning, or an ad slot serving malvertising. Injected JavaScript fingerprints the browser and OS, then either fires an exploit against a vulnerable plugin or renders a fake dialog, most commonly a browser update prompt styled to match the vendor. SocGholish, the campaign Red Canary and MITRE both document most thoroughly, favours the second path: it never needs a zero-day, it just needs the user to click 'update'.

Where drive-by compromise separates itself from simple social-engineering downloads is what happens next inside the process tree. A successful exploit hands the attacker code execution directly; a fake-update lure hands the JavaScript payload to the Windows Script Host, so the browser process becomes the direct parent of wscript.exe or cscript.exe running a .js file dropped to a temp directory. That parent-child relationship, browser to script host, is unusual enough on its own to anchor a detection, because browsers do not normally download a script and execute it themselves.

Once the script runs, the intrusion moves fast and mostly in memory. SocGholish's JavaScript performs system, software, and process discovery (whoami, listing installed AV, enumerating running processes), stages what it finds locally, and phones home over HTTP POST requests disguised as ordinary web traffic. The pivot into domain reconnaissance, nltest.exe with /domain_trusts or /all_trusts, is the signal that the infection is being handed off for further exploitation rather than left dormant.

Where Drive-by Compromise fits in an attack

Drive-by compromise sits at the very front of the kill chain, it is how the attacker gets a foothold without sending a single email. MITRE credits state-sponsored operators (APT28, APT32, Lazarus Group, Turla, Dragonfly) with running strategic web compromises and watering holes against specific industries or regions, while SocGholish, attributed to the group Mustard Tempest, runs the technique as a commodity service: infected browsers are sold on as initial access to other criminal groups, including ransomware affiliates and, per Proofpoint's research, has been linked to payloads associated with LockBit and Evil Corp operators.

What comes after the drive-by depends on the buyer. Red Canary's telemetry shows the wscript.exe stage frequently followed by domain-trust enumeration (nltest.exe) and, in a meaningful share of incidents, a second-stage payload such as NetSupport RAT or AsyncRAT, sometimes escalating to ransomware deployment. For a defender, that means the browser-spawns-script-host alert is not the end state to investigate, it is the earliest point to interrupt an intrusion chain that, left alone, ends in domain-wide encryption.

Detection Strategies

The following detection strategies help SOC analysts identify Drive-by Compromise activity. These methods apply across SIEM, XDR environments and can be implemented as detection rules, correlation queries, or behavioral analytics in your security platform.

SPL
index=* EventCode=1
  (ParentImage="*\\chrome.exe" OR ParentImage="*\\msedge.exe" OR ParentImage="*\\firefox.exe")
  (Image="*\\wscript.exe" OR Image="*\\cscript.exe" OR Image="*\\mshta.exe")
| table _time, ComputerName, User, ParentImage, Image, CommandLine

Sysmon process-creation events where a browser is the direct parent of a script host. Mirrors the browser-to-wscript.exe chain Red Canary documents as SocGholish's signature initial-execution step.

Simulated example generated by SOCSimulator Research
EventID: 1
UtcTime: 2026-07-16 03:14:22.118
Image: C:\Windows\System32\wscript.exe
CommandLine: wscript.exe //B //Nologo C:\Users\jmartin\AppData\Local\Temp\update_verify.js
User: CORP\jmartin
ParentImage: C:\Program Files\Microsoft\Edge\Application\msedge.exe
ParentCommandLine: "msedge.exe" --single-argument https://update-chrome-verify[.]net/check

Tuning and false positives

Legitimate browser update mechanisms genuinely spawn helper processes: Chrome and Edge run their own updater executables, macOS browsers invoke Apple's software-update framework, and enterprise deployment tools push browser patches through management agents that can look, at a glance, like a browser launching an installer. IT-approved extension installers and some browser-based automation or testing frameworks (headless Chrome driven by CI pipelines) will also spawn scripting engines as part of normal operation.

The fix is context, not blanket suppression. Exclude the specific vendor update paths and signed installer processes your fleet actually uses, and pay attention to the working directory: a script launched from a user's Temp or Downloads folder with a randomized filename is a different animal from an update binary running from Program Files. A browser-to-script-host event paired with an immediate outbound connection to a domain with no prior reputation in your environment is the combination worth escalating over one running from a known update channel.

Example Alerts

These realistic alert examples show what Drive-by Compromise looks like in your security tools. Use them to tune detection rules and train analysts to recognize true positives versus false positives in live environments.

HighXDR

Browser Spawned Windows Script Host with Network Egress

msedge.exe on WS-ACCT-22 launched wscript.exe against a .js file dropped from a compromised marketing site, and the script process opened an outbound connection within eight seconds. Browsers do not legitimately download and hand off execution to the Windows Script Host, this is the documented SocGholish fake-update chain.

CriticalXDR

Domain Trust Enumeration Following Script Execution

nltest.exe /domain_trusts ran under the same user session two minutes after a browser-spawned wscript.exe process on FS-01.corp.local. This reconnaissance step is the pivot point where a drive-by infection typically hands off to a ransomware affiliate.

MediumSIEM

Repeated Visits to Newly Registered Domain Preceding Payload Download

Proxy logs show six internal hosts hitting update-chrome-verify[.]net, a domain registered nine days earlier, each followed within a minute by a .js file download. The clustering across unrelated users and the domain's age both point to a watering-hole or SEO-poisoning campaign rather than isolated user error.

Responding to Drive-by Compromise

When this fires, start by identifying the source: which URL or domain the browser was pointed at, whether it matches a known-compromised or newly registered domain, and whether the resulting script or download came from a path consistent with legitimate software (Program Files, a signed vendor updater) or a temp directory with a generic filename. Check whether the script process made an outbound connection and to where, and whether any discovery commands (whoami, nltest, process enumeration) ran in the following minutes, that tells you whether this is a live infection or a blocked attempt.

If the script executed and reached out to the network, treat the host as compromised and move fast: isolate it before the reconnaissance phase completes and a second-stage payload lands, since SocGholish-style chains hand off to RATs and ransomware affiliates within the same session in a meaningful share of documented cases. Preserve the host for IR rather than reimaging immediately, capture the dropped script file and any staged data for analysis, and check other hosts that visited the same domain in the same window, watering-hole and SEO-poisoning campaigns rarely hit just one user.

Frequently Asked Questions

How do SOC analysts detect Drive-by Compromise?
Detection centers on SIEM, XDR telemetry for the initial access phase of the attack. Alert when a browser process (chrome.exe, msedge.exe, firefox.exe) is the direct parent of wscript.exe or cscript.exe, especially when that script process makes an external network connection shortly after launch, the signature SocGholish chain documented by Red Canary. Watch for nltest.exe running with /domain_trusts or /all_trusts immediately after a browser-spawned script process. That domain-trust enumeration is the follow-up reconnaissance step SocGholish operators run before handing off to ransomware affiliates.
What does a Drive-by Compromise alert look like?
A representative XDR detection is "Browser Spawned Windows Script Host with Network Egress" (high severity): msedge.exe on WS-ACCT-22 launched wscript.exe against a .js file dropped from a compromised marketing site, and the script process opened an outbound connection within eight seconds. Browsers do not legitimately download and hand off execution to the Windows Script Host, this is the documented SocGholish fake-update chain.
Which tools detect Drive-by Compromise, and how can I practice?
Drive-by Compromise (T1189) is best surfaced with SIEM, XDR telemetry, which exposes the initial access signals described above. Practice detecting it on those exact consoles in SOCSimulator Operations, free.

Practice Drive-by Compromise in a Free Room

Investigate Drive-by Compromise on realistic SIEM, XDR, and firewall consoles, free.

Glossary

What is Phishing? SOC Glossary

Phishing is a social engineering attack delivered via email, SMS, voice calls, or other channels that deceives recipient…

Read more
Glossary

What is Attack Surface? SOC Glossary

An organization's attack surface is the total set of points where an adversary could attempt unauthorized access: networ…

Read more
Glossary

What is Social Engineering? SOC Glossary

Social engineering is the psychological manipulation of individuals into performing actions or revealing information tha…

Read more
Glossary

What is IOC? SOC Glossary

An Indicator of Compromise (IOC) is an observable artifact, such as a file hash, IP address, domain name, URL, registry …

Read more
Career Path

SOC Analyst (Tier 1) Career Guide: Salary & Skills

Tier 1 SOC Analysts are the front line. You monitor alert queues, triage incoming detections, classify them as true or f…

Read more
Career Path

SOC Analyst (Tier 2) Career Guide: Salary & Skills

Tier 2 SOC Analysts handle the investigations that Tier 1 escalates. You dig into multi-stage attacks, coordinate contai…

Read more
Tool

SIEM Training Console: SOCSimulator

The SIEM console in SOCSimulator replicates the workflow of enterprise platforms like Splunk Enterprise Security, Micros…

Read more
Tool

XDR Training Console: SOCSimulator

The XDR console in SOCSimulator replicates the investigation workflow of platforms like CrowdStrike Falcon, Microsoft De…

Read more
Comparison

SOCSimulator Vs. Letsdefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more
Glossary

SOC Glossary: Security Operations Terminology

Complete glossary of Security Operations Center terminology for aspiring SOC analysts.

Read more
Feature

Shift Mode: Real-Time SOC Simulation

Practice alert triage under realistic time pressure with SLA timers and noise injection.

Read more
Feature

Operations: Guided Training Operations

Structured CTF-style investigation operations covering real-world attack scenarios.

Read more