Join our Newsletter — 33% off our NHI Course
Home› Guides› Drive-by Downloads Guide: Compromised Sites, Exploit Kits and…
Guide Attack Techniques & Malware

Drive-by Downloads Guide: Compromised Sites, Exploit Kits and Browser Defences

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 26 October 2026 12 min read
On this page

A drive-by download is malware delivered to a computer simply because the user visited a web page, either silently through a browser or plug-in exploit, or by a page that tricks the user into running a file they did not mean to install. The user does not open an email attachment or go looking for software: the website, an advert on it or a script it loads does the work. MITRE ATT&CK tracks the technique as T1189 Drive-by Compromise. This explainer covers how compromised and malicious sites deliver payloads, what happened to exploit kits, why the threat has shifted towards social engineering in the browser, and the layered browser and endpoint defences that stop it. It is for endpoint, SOC and IT teams who manage browsers at scale.

Key takeaways

  • The website is the delivery vehicle. Legitimate sites that have been compromised, malicious adverts, poisoned third-party scripts and attacker-run look-alike sites all serve drive-by content.
  • Exploit kits peaked and declined. Automated browser and plug-in exploitation was common in the Flash and Java era; with those plug-ins gone and browsers auto-updating, most drive-by activity now relies on fake updates and lures that persuade the user to run a file.
  • Patching the browser is the biggest single control. Fast automatic updates, sandboxing and Site Isolation remove most of the silent-exploit path; what remains is mostly zero-day or n-day exploitation of unpatched browsers.
  • Reputation and script controls catch the user-assisted path. SmartScreen or Safe Browsing with bypass disabled, ASR rules and application control stop downloaded files from running.
  • Isolation and EDR are the safety net. Remote browser isolation keeps risky content off the endpoint, and EDR catches the browser spawning unexpected processes.

What it is

In everyday terms, a drive-by download is like picking up an infection by walking into the wrong shop: you did nothing obviously risky, but the premises were contaminated. In security terms there are two forms:

  • Silent exploitation: script on the page fingerprints the browser and, if a vulnerable version is found, exploits it to run code with no user action beyond the visit. ATT&CK links this to T1203 Exploitation for Client Execution.
  • User-assisted download: the page shows a convincing prompt, such as a fake browser update, missing font or document viewer, and the user runs the file. This leads to T1204.002 Malicious File.

ATT&CK v20 lists the delivery routes for T1189: a legitimate website compromised to inject code; script files served from a publicly writable cloud storage bucket that an attacker modifies; malicious adverts bought through legitimate ad networks (T1583.008 Malvertising); and user-controllable content such as cross-site scripting. It also notes abuse of browser push notification permissions. When the compromised site is chosen because a specific community visits it, the campaign is a watering hole, covered separately in the Watering Hole Attacks Guide.

How it works

A typical chain has four stages. Defenders can break it at any one of them.

  1. Staging: the attacker prepares infrastructure and content (ATT&CK T1608.004 Drive-by Target), for example by injecting script into a content management system, a compromised plug-in or theme, a third-party library or an ad creative.
  2. Redirection and filtering: the injected code sends visitors through one or more redirects. Filtering by country, browser, operating system, referrer or whether the visitor looks like a security scanner keeps the payload hidden from researchers.
  3. Delivery: either an exploit runs against the browser, or a lure page offers a download.
  4. Execution and follow-on: the payload, often a loader, infostealer or remote access tool, runs and reaches out to command and control. Infostealers turn one visit into stolen browser sessions, saved passwords and tokens; see the Infostealer Threat Guide.

Delivery routes compared

RouteHow the visitor is reachedTypical lure or methodBest control point
Compromised legitimate siteInjected script in a trusted siteFake update overlay, redirect to exploit or lureWeb filtering, reputation, EDR; site owners: CMS patching and file integrity
MalvertisingPaid adverts on legitimate sites or search resultsRedirect to download page impersonating softwareAd and DNS filtering, reputation, allowlisted software sources; see the Malvertising and SEO Poisoning Guide
Third-party script supply chainA library or CDN script many sites loadScript altered at source; Sansec reported the 2024 polyfill.io case affected more than 100,000 sites after the project changed ownerSite owners: self-host or pin with Subresource Integrity, Content Security Policy
Attacker-run look-alike siteSEO poisoning, typosquats, links in chatTrojanised installerSoftware request process, application control, reputation
Push notification abuseUser grants notification permissionRepeated fake alerts leading to downloadsBrowser policy blocking notification prompts from unknown sites

Exploit kits: history and decline

Exploit kits were commercial toolkits that packaged browser and plug-in exploits behind a landing page and sold access as a service. They were most active in the first half of the 2010s, when Adobe Flash Player, Java browser plug-ins and older Internet Explorer versions gave them a large, slowly patched target. Their decline followed the removal of those targets: browsers moved plug-ins out (Flash reached end of life at the end of 2020), auto-update became the default, and sandboxing raised the cost of each working exploit chain. The NCSC still advises treating plug-ins such as Java, Flash and Silverlight as a major route to compromise and removing them where not needed. Silent drive-by exploitation has not disappeared, but today it is mostly targeted use of browser zero-days, which the Zero-Day and Exploited Vulnerabilities Guide covers.

Why it matters

Drive-by delivery bypasses email security entirely and reaches users through sites they trust, including on unmanaged and home networks. Fake update and trojanised installer campaigns are a common first step towards ransomware and credential theft. Because the payload often steals browser-held sessions and tokens, one visit can expose SaaS, cloud and developer credentials, including those of service accounts saved in a browser profile.

Browser and endpoint defences

LayerControlSpecificsStops
Browser patchingAutomatic updates, version monitoringNCSC: auto-update browsers and extensions and monitor versions in use; set a forced relaunch deadline through policyKnown-vulnerability exploitation
Browser architectureSandbox and Site IsolationChromium Site Isolation puts each site in its own process and defends against a fully compromised renderer on desktop; the sandbox limits access to the local machineExploit escalation and cross-site data theft
Browser hardeningEdge enhanced security mode or JIT disablementEnhanceSecurityMode (Balanced or Strict) disables JavaScript JIT and enables ACG, CFG and hardware-enforced stack protection on unfamiliar sites; DefaultJavaScriptJitSetting = BlockJavaScriptJitMany memory-corruption exploits
ReputationMicrosoft Defender SmartScreen or Google Safe BrowsingEdge policies "Prevent bypassing Microsoft Defender SmartScreen prompts for sites" and "...warnings about downloads" (CSP Browser/PreventSmartScreenPromptOverride and PreventSmartScreenPromptOverrideForFiles); Windows "Warn and prevent bypass"Known-bad sites and low-reputation downloads
Script and execution controlsASR rules, application control"Block JavaScript or VBScript from launching downloaded executable content" (d3e037e1-3eb8-44c8-a917-57927947596d); "Block executable files from running unless they meet a prevalence, age, or trusted list criterion" (01443614-cd74-433a-b99e-2ecdc07bfc25); "Block execution of potentially obfuscated scripts" (5beb7efe-fd9a-4556-801d-275e5ffc04cc)User-assisted payloads
IsolationRemote browser isolationRender uncategorised or risky sites remotely; see the Remote Browser Isolation GuideExploits and downloads reaching the endpoint
DetectionEDRAlert on browser processes spawning script hosts or shells; see the EDR GuidePayloads that get through

Two limits are worth knowing. SmartScreen does not protect against malicious files on internal UNC or SMB shares, per Microsoft's documentation. And the NCSC advises against disabling JavaScript wholesale, because it breaks the modern web; targeted controls work better.

Rolling out the controls

  1. Baseline: inventory browsers, versions and extensions across the estate; remove unsupported browsers and legacy plug-ins, keeping a separate browser only for any unmigratable legacy app, as NCSC suggests.
  2. Patch cadence: enforce auto-update with a relaunch deadline (for example 24 to 72 hours) and track version compliance. See the Patch Management Guide.
  3. Reputation with no bypass: enable SmartScreen or Safe Browsing and the prevent-bypass policies first for a pilot ring, review the false positives reported, then extend.
  4. ASR in audit mode: deploy the script and prevalence rules in Audit, review AsrScriptExecutableDownloadAudited and AsrUntrustedExecutableAudited events in advanced hunting for two to four weeks, add narrow exclusions, then switch to Block. Roll back by returning a rule to Audit, not by removing it.
  5. Harden browsing: enable enhanced security mode in Balanced, block notification prompts and restrict extensions to an allowlist.
  6. Isolate the residual risk: send uncategorised and newly registered domains to isolation or a read-only view rather than blocking everything.
  7. Control software sources: provide a self-service catalogue so users have no reason to download installers from search results, and back it with application control. See the Application Allowlisting Guide.

Choosing controls by organisation size

  • Small organisations: managed auto-updating browsers, built-in reputation with bypass disabled, standard users without local admin, and protective DNS cover most of the risk at little cost.
  • Large organisations: add ASR or equivalent execution controls, application control, isolation for risky categories and EDR detections tuned for browser child processes. An enterprise browser may suit some groups; see the Enterprise Browser and Browser Security Guide.
  • Isolation versus blocking: blocking uncategorised sites is cheaper but generates help desk tickets; isolation keeps users productive at the cost of licences and some rendering issues. Many teams isolate only uncategorised and high-risk categories.

Detection and measurement

  • Process signals: browser processes launching wscript.exe, cscript.exe, mshta.exe, powershell.exe or cmd.exe; files with Mark of the Web executed from Downloads shortly after a browser visit.
  • Network signals: visits to newly registered domains followed by a download, redirect chains through several unrelated domains, and DNS lookups for known malicious infrastructure.
  • Browser signals: SmartScreen or Safe Browsing block events, users who repeatedly trigger warnings, and out-of-date browser versions.

Useful metrics: percentage of endpoints on the current browser version within 72 hours of release; ASR block events per 1,000 endpoints and the false-positive rate; count of reputation warnings bypassed (target zero once prevent-bypass is enforced); share of software installs coming from the approved catalogue; mean time from browser-spawned suspicious process to containment.

Framework mapping

FrameworkReferenceRelevance
MITRE ATT&CK v20T1189, T1203, T1204.002, T1583.008, T1608.004, T1659; mitigations M1048 Application Isolation and Sandboxing, M1050 Exploit Protection, M1051 Update Software, M1021 Restrict Web-Based Content, M1017 User TrainingTechnique chain and mitigations
NIST SP 800-53 Rev 5SI-2, SI-3, SC-18, SC-44, CM-7, SI-4Flaw remediation, malicious code protection, mobile code, detonation chambers, least functionality, monitoring
NIST CSF 2.0PR.PS-02, DE.CM-09Software maintained commensurate with risk; computing environments monitored
CIS Controls v8.1Control 9 Email and Web Browser Protections; Control 10 Malware Defenses; Control 7 Continuous Vulnerability ManagementSupported browsers, DNS and URL filtering, extension restriction, anti-malware
ISO/IEC 27001:2022 Annex AA.8.7 Protection against malware, A.8.8 Management of technical vulnerabilities, A.8.23 Web filteringMalware, patching and web filtering controls

Common misconceptions

  • "Only shady sites are dangerous": compromised legitimate sites and malicious adverts on mainstream sites are standard routes in ATT&CK's own description of T1189.
  • "Exploit kits are gone, so drive-bys are gone": the silent-exploit share fell, but fake update and trojanised installer lures delivered the same way are common.
  • "Antivirus will catch it": loaders change quickly; reputation, execution controls and behaviour detection matter more than signatures.
  • "Users who see a warning will stop": without prevent-bypass policies many click through, which is why Microsoft recommends enabling them.
  • "Disable JavaScript to be safe": NCSC advises against it; harden JIT and isolate instead.

Failure patterns that recur: browsers left waiting for a user restart for weeks, so "auto-update" never applies; reputation enabled but bypass allowed; users with local admin rights who can install anything a page offers; broad ASR exclusions for whole folders such as Downloads; and website owners loading third-party scripts from CDNs without Subresource Integrity, turning their own site into a delivery vehicle.

Practitioner checklist

  • Enforce automatic browser updates with a relaunch deadline and report version compliance weekly.
  • Remove unsupported browsers and legacy plug-ins; restrict extensions to an allowlist.
  • Enable SmartScreen or Safe Browsing with prevent-bypass policies for sites and downloads.
  • Deploy ASR script, prevalence and obfuscation rules in Audit, tune, then Block.
  • Enable Edge enhanced security mode (Balanced) or equivalent JIT restrictions for unfamiliar sites.
  • Remove local admin rights from standard users and back them with application control.
  • Route uncategorised and newly registered domains to isolation or block, and use protective DNS.
  • Alert in EDR on browsers spawning script hosts or shells.
  • For your own websites, pin third-party scripts with Subresource Integrity and enforce a Content Security Policy.

Standards and references

Related NHI Mgmt Group resources: Watering Hole Attacks Guide · Malvertising and SEO Poisoning Guide · Remote Browser Isolation Guide · Infostealer Threat Guide · Man-in-the-Middle Attacks Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 26 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.