Executive Summary
Drive-by Compromise (T1189) is a MITRE ATT&CK technique associated with Initial Access. Adversaries may gain access to a system through a user visiting a website over the normal course of browsing.
Why Attackers Use It
Attackers use Drive-by Compromise because it provides a reliable way to advance their objective within the Initial Access tactic, often with a favorable balance of impact versus detectability on Identity Provider, Linux, macOS, Windows environments. Defenders should assess this behavior in the context of the affected platform and adjacent activity rather than treating it as a standalone indicator.
MITRE Description
Adversaries may gain access to a system through a user visiting a website over the normal course of browsing. Multiple ways of delivering exploit code to a browser exist (i.e., Drive-by Target), including:
- A legitimate website is compromised, allowing adversaries to inject malicious code
- Script files served to a legitimate website from a publicly writeable cloud storage bucket are modified by an adversary
- Malicious ads are paid for and served through legitimate ad providers (i.e., Malvertising)
- Built-in web application interfaces that allow user-controllable content are leveraged for the insertion of malicious scripts or iFrames (e.g., cross-site scripting)
Browser push notifications may also be abused by adversaries and leveraged for malicious code injection via User Execution. By clicking "allow" on browser push notifications, users may be granting a website permission to run JavaScript code on their browser.(Citation: Push notifications - viruspositive)(Citation: push notification -mcafee)(Citation: push notifications - malwarebytes)
Often the website used by an adversary is one visited by a specific community, such as government, a particular industry, or a particular region, where the goal is to compromise a specific user or set of users based on a shared interest. This kind of targeted campaign is often referred to a strategic web compromise or watering hole attack. There are several known examples of this occurring.(Citation: Shadowserver Strategic Web Compromise)
Typical drive-by compromise process:
- A user visits a website that is used to host the adversary controlled content.
- Scripts automatically execute, typically searching versions of the browser and plugins for a potentially vulnerable version. The user may be required to assist in this process by enabling scripting, notifications, or active website components and ignoring warning dialog boxes.
- Upon finding a vulnerable version, exploit code is delivered to the browser.
- If exploitation is successful, the adversary will gain code execution on the user's system unless other protections are in place. In some cases, a second visit to the website after the initial scan is required before exploit code is delivered.
Unlike Exploit Public-Facing Application, the focus of this technique is to exploit software on a client endpoint upon visiting a website. This will commonly give an adversary access to systems on the internal network instead of external systems that may be in a DMZ.
Attack Flow
- Attacker gains the prerequisite access or context described below.
- Attacker executes Drive-by Compromise to achieve its tactical objective (Initial Access).
- Resulting access/data/effect is leveraged to advance the broader attack chain (see Related Techniques).
Prerequisites
- Platform(s): Identity Provider, Linux, macOS, Windows
- ATT&CK does not define one universal permission requirement for this technique. Establish the required access from the observed implementation and affected platform.
Common Tools
- Tool attribution is implementation-specific. Use ATT&CK procedure examples and local telemetry to identify the binaries, services, scripts, accounts, or cloud resources involved.
Commands
No universal command represents Drive-by Compromise. Capture the exact command line, arguments, parent process, account, host, and execution time from the investigated environment; do not operationalize unverified examples.
Network Traffic
- Network observability is implementation-dependent. Review DNS, proxy, firewall, flow, authentication, and packet telemetry around the activity window, then correlate remote endpoints and protocol behavior with host evidence.
Windows Events
| Event ID | Log Channel | What It Indicates |
|---|
| Environment-specific | Relevant Windows channel(s) | Correlate authentication, process, object-access, and configuration events with the observed execution context. |
Sysmon Events
| Sysmon Event ID | Name | Why It's Relevant Here |
|---|
| Environment-specific | Validate configured telemetry | Use process, network, file, registry, DNS, or image-load telemetry only when relevant and enabled. |
Detection Opportunities
No MITRE detection guidance published for this technique.
Relevant ATT&CK Data Sources: N/A
Sigma Rules
A universal Sigma rule would create unreliable results because this technique has no single guaranteed observable. Build detection logic from a documented behavior and supported data source, scope it to the affected platform, and validate it against benign administrative activity before deployment.
Splunk Queries
Start with the data sources named in the detection section. Scope searches by asset, identity, and time window; correlate the primary behavior with preceding access and subsequent actions. A portable query is intentionally not provided where the technique lacks a universal schema or observable.
Investigation Workflow
- Confirm that the observed behavior is consistent with Drive-by Compromise and rule out expected administrative or application activity.
- Establish the first-seen time, initiating identity, source system, target system, and affected resources.
- Collect relevant host, identity, network, cloud, and application telemetry for the surrounding time window.
- Correlate parent and child activity, remote connections, file or configuration changes, and related ATT&CK techniques.
- Determine scope by searching for the same observable across peer assets and identities.
- Preserve volatile evidence and record confidence, assumptions, and telemetry gaps before containment.
Containment
- Isolate affected host(s)/account(s) identified during investigation.
- Revoke or rotate any credentials/tokens potentially exposed.
- Apply the mitigations listed below where not already enforced.
- Validate no related techniques (see Related Techniques) were chained against the same asset.
Mitigation
- M1050 -- Exploit Protection: Deploy capabilities that detect, block, and mitigate conditions indicative of software exploits.
- M1051 -- Update Software: Software updates ensure systems are protected against known vulnerabilities by applying patches and upgrades provided by vendors.
- M1048 -- Application Isolation and Sandboxing: Application Isolation and Sandboxing refers to the technique of restricting the execution of code to a controlled and isolated environment (e.g., a virtual environment, container, or sandbox).
- M1021 -- Restrict Web-Based Content: Restricting web-based content involves enforcing policies and technologies that limit access to potentially malicious websites, unsafe downloads, and unauthorized browser behaviors.
- M1017 -- User Training: User Training involves educating employees and contractors on recognizing, reporting, and preventing cyber threats that rely on human interaction, such as phishing, social engineering, and other manipulative techniques.
Related Techniques
- T1027.013
- T1036.005
- T1071.001
- T1082
- T1105
- T1204.001
- T1204.002
- T1566.001
- T1587.002
- T1608.004