Course contentsShow
← Security
Lesson 1528 of 3,05231. Operating System Security - MalwareFree lesson

Drive-by Downloads and Web-Based Infection

Malware delivery through compromised websites, exploit kits, and malicious advertisements without user interaction.

Drive-by Downloads and Web-Based Infection

You'll learn how malware can infect systems through compromised websites without any active user participation.

Core Concept

Drive-by downloads are a stealthy malware delivery mechanism where simply visiting a compromised or malicious website can infect your system—no clicking, no downloading, no conscious user action required. It's like walking past a shop and somehow ending up with items in your pocket without realizing it.

How It Works

Compromised Websites: Legitimate websites get hacked and injected with malicious code. Attackers exploit vulnerabilities in the web server, CMS platforms, or plugins to plant their payload. When you visit what looks like a trusted site, hidden scripts execute in your browser.

Exploit Kits: These are pre-packaged toolkits that automatically probe your browser, plugins (Flash, Java), and operating system for known vulnerabilities. When they find a weakness—an unpatched browser, outdated plugin, or OS vulnerability—they deliver malware tailored to that specific flaw. Popular exploit kits include Angler, RIG, and Magnitude.

Malicious Advertisements (Malvertising): Attackers buy legitimate advertising space or compromise ad networks. Even on trusted sites, a malicious ad loads in the background and executes exploit code. This is particularly dangerous because users trust the main site completely.

The Infection Chain

The attack happens silently: compromised page loads → exploit kit scans for vulnerabilities → successful exploit bypasses browser security → payload downloads and executes → system infected. All of this occurs during normal browsing, often within seconds.

Prevention

Keep browsers and plugins updated, disable unnecessary plugins, use ad blockers, and employ browser security extensions. Modern browsers have improved sandboxing and exploit mitigation, but zero-day vulnerabilities still pose risks.

Key Takeaway: Drive-by downloads exploit browser and plugin vulnerabilities to install malware on systems through passive website visits, making patching and secure browsing practices critical defensive measures.