This article needs additional citations for verification. (April 2021)
- Downloads which a person has authorized but without understanding the consequences (e.g. downloads which install an unknown or counterfeit executable program, ActiveX component, or Java applet).
- Any download that happens without a person's knowledge, often a computer virus, spyware, malware, or crimeware.
Drive-by downloads may happen when visiting a website, opening an e-mail attachment or clicking a link, or clicking on a deceptive pop-up window: by clicking on the window in the mistaken belief that, for example, an error report from the computer's operating system itself is being acknowledged or a seemingly innocuous advertisement pop-up is being dismissed. In such cases, the "supplier" may claim that the user "consented" to the download, although the user was in fact unaware of having started an unwanted or malicious software download. Similarly if a person is visiting a site with malicious content, the person may become victim to a drive-by download attack. That is, the malicious content may be able to exploit vulnerabilities in the browser or plugins to run malicious code without the user's knowledge.
A drive-by install (or installation) is a similar event. It refers to installation rather than download (though sometimes the two terms are used interchangeably).
When creating a drive-by download, an attacker must first create their malicious content to perform the attack. With the rise in exploit packs that contain the vulnerabilities needed to carry out drive-by download attacks, the skill level needed to perform this attack has been reduced.
The next step is to host the malicious content that the attacker wishes to distribute. One option is for the attacker to host the malicious content on their own server. However, because of the difficulty in directing users to a new page, it may also be hosted on a compromised legitimate website, or a legitimate website unknowingly distributing the attackers content through a third party service (e.g. an advertisement). When the content is loaded by the client, the attacker will analyze the fingerprint of the client in order to tailor the code to exploit vulnerabilities specific to that client.
Finally, the attacker exploits the necessary vulnerabilities to launch the drive-by download attack. Drive-by downloads usually use one of two strategies. The first strategy is exploiting API calls for various plugins. For example, the DownloadAndInstall API of the Sina ActiveX component did not properly check its parameters and allowed the downloading and execution of arbitrary files from the internet. The second strategy involves writing shellcode to memory, and then exploiting vulnerabilities in the web browser or plugin to divert the control flow of the program to the shell code. After the shellcode has been executed, the attacker can perform further malicious activities. This often involves downloading and installing malware, but can be anything, including stealing information to send back to the attacker.
The attacker may also take measures to prevent detection throughout the attack. One method is to rely on the obfuscation of the malicious code. This can be done through the use of IFrames. Another method is to encrypt the malicious code to prevent detection. Generally the attacker encrypts the malicious code into a ciphertext, then includes the decryption method after the ciphertext.
Detection and prevention
Drive-by downloads can also be prevented from occurring by using script-blockers such as NoScript, which can easily be added into browsers such as Firefox. Using such a script-blocker, the user can disable all the scripts on a given webpage, and then selectively re-enable individual scripts on a one-by-one basis in order to determine which ones are truly necessary for webpage functionality. In this way, a whitelist of acceptable scripts can quickly be developed, which in turn facilitates convenient, safe, and efficient browsing of other websites. Such script-blocking also saves time and bandwidth (hence money) for the user, because scripts that load advertising (especially targeted ads) and invade the user's privacy (via tracking and profiling) no longer constitute a personal drain on the user and their resources.
- "Exploit on Amnesty pages tricks AV software". The H online. Heinz Heise. 20 April 2011. Retrieved 8 January 2011.
- Olsen, Stefanie (8 April 2002). "Web surfers brace for pop-up downloads". CNET News. Retrieved 28 October 2010.
- Le, Van Lam; Welch, Ian; Gao, Xiaoying; Komisarczuk, Peter (1 January 2013). Anatomy of Drive-by Download Attack. Proceedings of the Eleventh Australasian Information Security Conference - Volume 138. AISC '13. Darlinghurst, Australia, Australia: Australian Computer Society, Inc. pp. 49–58. ISBN 9781921770234.
- Egele, Manuel; Kirda, Engin; Kruegel, Christopher (1 January 2009). "Mitigating Drive-By Download Attacks: Challenges and Open Problems". iNetSec 2009 – Open Research Problems in Network Security. IFIP Advances in Information and Communication Technology. 309. Springer Berlin Heidelberg. pp. 52–62. doi:10.1007/978-3-642-05437-2_5. ISBN 978-3-642-05436-5.