Skip to main content

Drive-By Downloads - Silent Malware Installation

About 2 min read

A drive-by download is an attack technique in which a user becomes infected with malware merely by viewing a web page, without performing any click or download action. Because it exploits vulnerabilities in browsers or plugins to execute arbitrary code, even security-conscious users can fall victim. It is an attack to which the belief that "you are safe as long as you do not visit suspicious sites" does not apply, and in some cases legitimate sites are tampered with and used as a stepping stone for the attack.

How the Attack Works

User
Views web page
Tampered page
Malicious JS / iframe
Exploit kit
Auto-scans vulnerabilities
Payload delivery
Malware execution

At the core of the attack is the exploit kit (EK). EKs such as Angler, RIG, and Magnitude automatically fingerprint the type, version, and installed plugins of the visiting browser, then select an available vulnerability and deliver the attack code.

Malvertising - Infection via Ad Networks

Malvertising is a technique that slips malicious advertisements into legitimate ad networks. Attackers purchase ad space legitimately and embed attack code inside the ad creative. In some cases, simply displaying the ad (without clicking it) redirects the user to an exploit kit.

Infection vectorHow it worksScope of impact
Site tamperingInjects attack code into the HTML/JS of a legitimate siteAll visitors to that site
MalvertisingDelivers malicious ads via ad networksVisitors of all sites where the ad is shown
Third-party scriptsCompromises external JS libraries or widgetsAll sites that load that script

In 2016, the ad spaces of major news sites such as MSN.com, BBC, and The New York Times were abused for malvertising and used to deliver the Angler EK. Because infection can occur merely by browsing a legitimate site, "only viewing trusted sites is safe" does not hold.

Relationship with the Watering Hole Attack

A watering hole attack is a targeted attack in which the attacker first researches the websites that employees of the target organization frequently visit, then embeds a drive-by download trap on those sites. Unlike malvertising, which targets the general public indiscriminately, its hallmark is pinpointing a specific organization or industry. Venues where people from a particular industry gather, such as industry association sites and specialized media outlets, may be chosen as stepping stones.

Defense via the Browser Sandbox

Modern browsers use sandbox technology to isolate the processes that render web pages from OS resources. In Chrome's multi-process architecture, the design leaves almost no OS-level resources that the renderer process can access, even if it is compromised. However, sandbox escape vulnerabilities have also been found.

Effective defenses
  • Enable automatic updates for the browser and OS
  • Remove unnecessary plugins (Flash, Java)
  • Introduce an ad blocker
  • Network-level URL filtering
Measures with limited effect
  • "Avoiding suspicious sites" (legitimate sites get tampered with too)
  • Signature-based antivirus alone
  • Disabling JavaScript entirely (usability drops)
  • Relying on user education alone

The Importance of Patch Management

Some drive-by downloads exploit known vulnerabilities. Keeping browsers, the OS, and plugins up to date through patch management reduces the room for such known vulnerabilities to be exploited.

"I never clicked anything, so I can't possibly get infected" is an assumption that does not hold for drive-by downloads.

The risks of browser extensions are explained in detail in our article on browser extension security, and safe app adoption in our article on installing apps safely. Please also refer to ransomware protection.

Was this article helpful?

Related Terms