What is a drive-by attack?
It is an infection that happens just by visiting a page, without the victim downloading or opening anything. The site — compromised, or legitimate but serving malicious advertising — loads code exploiting a vulnerability in the browser, a plugin or the JavaScript engine, and runs malware through that flaw. For the user there is no moment that looks like accepting anything.
How it arrives: visiting shady sites is not required
The most uncomfortable vector is malvertising: legitimate ad networks serving prepared ads on perfectly normal outlets. Also used are compromised popular sites, injections into third-party libraries that thousands of pages load, and chained redirects from search results. The belief that avoiding suspicious sites is enough is exactly what makes this technique effective.
How to protect yourself?
Keeping browser and system patched closes the most, because the attack depends on a known vulnerability; modern browsers also isolate each tab in its own process. Add script and ad blockers — which remove the malvertising channel — disable or isolate unnecessary plugins, and in organizations, EDR able to see anomalous execution spawned from the browser process.



