Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have seen these a lot lately. You click the link, and instant trojan. No need to download or anything.

How is this possible? Is there a way I can scan the links before visiting to make sure I won't be infected?

share|improve this question

migrated from stackoverflow.com Feb 9 '10 at 20:12

This question came from our site for professional and enthusiast programmers.

    
Possible duplicate: superuser.com/questions/13507/… –  Hello71 Aug 31 '10 at 14:46
    
It is possible because web browsers (like internet explorer) are extremely complex pieces of software and despite being well-written. There are flaws the hackers discover which can be utilized to run a program of their choice on your machine, such as a trojan. –  unixman83 Mar 9 '12 at 3:52

6 Answers 6

up vote 12 down vote accepted

To answer how it's possible:

The site has some script that gets executed as you load the page. This is what infects your Windows PC - I'm not 100% sure of the details though, whether it downloads the code or just runs it. This page has an example of how it was done in one case. A vulnerable browser is also required, and virtually any popular browser is a vulnerable one as something running on a lot of computers is worth targeting.

It will be Windows PC's for the most part that get infected as people run as admin's rather than restricted users. The reasons for this are many and varied. As Roger points out in his comment its popularity rather than any intrinsic weakness that's the main factor here:

Windows is targeted more because it is more popular. Some say that Windows is less secure than alternatives too, but I have to say that in the way you highlight, it's not. I run Linux at home and if a trojan could run under my user account it could still do quite a lot of damage to files that I care about quite a bit, it just couldn't take over the system.

Though by running with a restricted rights user you can limit the damage, but not necessarily eliminate it.

With Vista and now 7 having tighter control over what gets run as admin you might start to see a drop in these sorts of sites - though it will only be when the majority are running the newer OS's.

share|improve this answer
    
Thanks. I just find it hard to believe that it can automatically make your browser download and run it though. What sort of script would that be? JavaScript? –  Rob Feb 9 '10 at 20:27
    
@Rob - Yes it'll be JavaScript, and it does require a vulnerable browser and the user being an admin. –  ChrisF Feb 9 '10 at 20:28
    
It managed to install itself through FireFox. So much for safest webbrowser. fml –  Rob Feb 9 '10 at 20:30
    
@Rob - Firefox hasn't been the safest browser for a while. As soon as it hit a decent market share the virus and trojan writers started looking for exploits as it became worth their while. If you want "safe" browsing pick the browser with the lowest market share ;) –  ChrisF Feb 9 '10 at 20:33
    
Unfortunately I'm afraid of change. I'll stick with firefox, as it has a ton of addons I use on a daily basis. FML again. Now I just need to know if its possible to accept two answers on one question? –  Rob Feb 9 '10 at 20:35

Well, when you open a website, the website can direct the browser to do all kinds of things on its behalf. In the simplest case it will just send text and pictures to be displayed, but it can also send small programs that the browser will run (in JavaScript, which browsers have built in, or using a browser plugin such as Java or Flash).

In principle, getting infected just from visiting a website should be impossible:

While browsers will execute programs on behalf of websites you visit, these programs are carefully restricted so they can only do "harmless" things. From Javascript, you can for example alter the page that the Javascript belongs to (since both come from the same website, there can be no harm), but Javascript may not change a page from a different website (so a sleazy site cannot alter your home banking display), and it may not directly access files on your computer.

Similar restrictions exist for most plugins (at least for Java and Flash). This is commonly referred to as sandboxing, as the code is essentially in a box of its own, isolated from the computer it runs on. In particular, it cannot read files on your hard disk, or start programs for you, like "regular" programs running on your computer can.

Now, the thing is: while in principle you're safe, in practice you may not be. The reason is that the sandbox system, like all programs, has bugs. Sometimes these bugs allow a program to "break" the sandbox and trick the browser or plugins to do things it should not be allowed to do. These tricks can be quite elaborate.

Examples:

  • Like regular programs, the implementation of the browser or plugin can have buffer overflows, which can allow a website to run specially crafted code by sending it to the browser as input
  • There was a vunerability in old versions of Sun's Java plugin with respect to the sandbox. The sandbox disallowed (and still disallows) access to all Java functions which could allow a program to do damage, such as reading or deleting local files. However, while the sandbox did correctly block access to these functions from a Java applet, browsers also allowed indirect access to these functions from Javascript (via a technique called "reflection"). This "backdoor" had not been sufficiently considered by developers, and allowed to bypass the sandbox restrictions, breaking the sandbox. See http://jouko.iki.fi/adv/javaplugin.html for details.

Unfortunately, there have been several vulnerabilities in the sandboxes of Javascript, of Java and of Flash, just to name a few. It's still a kind of race between malicious hackers who detect these vulnerabilities to exploit them, and good hackers and developers who detect and fix them. Usually, they are fixed quickly, but there is sometimes a window of vulnerability.

BTW: The sandbox is the reason some Java applets pop up a "Do you trust this applet" warning on launch: These applets ask you to let them out of their sandbox and to give them access to your computer. This is sometimes necessary, but should only be granted with good reasons.

P.S.: The reason that ActiveX (at least early versions) were so horribly insecure is that ActiveX did not use a sandbox. Any ActiveX code from a webpage had full access to your system. To be fair, this was (partially) rectified in later versions.

share|improve this answer

You could install something free such as AVG LinkScanner. It will scan the links before they have chance to do any damage.

If you use Google Chrome, it offers some protection from links that end up on pages infected with malware. It displays a nice warning message BEFORE loading the actual page up.

enter image description here

The latest version of Internet Explorer includes SmartScreen Filter which does the same thing.

enter image description here

share|improve this answer
    
Thanks alot. Still curious as to how its possible. –  Rob Feb 9 '10 at 20:23
    
One common method is for websites to host malicious code within the webpage that exploits vulnerabilities in your browser for example. Sometimes even the ads displayed on a website can be malicious enough to do damage, if they have been designed for such a purpose. –  Kez Feb 9 '10 at 20:27
    
I'll check out the AVG Link Scanner. As I commented the other answer, I'm afraid of change and enjoy my firefox. Thanks. –  Rob Feb 9 '10 at 20:39
    
FireFox 3 and upwards includes this kind of built-in protection too, so no need to change. See mozilla.com/en-US/firefox/phishing-protection. Obviously no single piece of software out there is perfect, but the built-in browser protection you get with modern browsers nowadays is better than a poke in the eye. –  Kez Feb 9 '10 at 20:50

Some good firefox extensions to protect yourself:

And to run your browser(s) in an isolated space: Sandboxie

share|improve this answer

I mention this to answer your last question about preemptive actions. One not-so-common option is to use a virtual machine (well, it is common among security circles). There are a few free ones available. Install your OS, browser, and add-ins in the virtual machine and save the state. You can then browse to any site. When finished, you revert to that saved state and anything that happened in the virtual machine after that point is discarded. It's very simple once you get into it, but may pose a slight learning curve.

Note: Reverting state will literally discard any changes to the virtual machine; including browser history, cookies, updates, etc. In this case, you could revert to that state, apply updates, and save a new state. The same can be done for anything else you wish to keep. None of this affects your actual computer, only the virtual machine.

share|improve this answer
    
This is not really practical. Noscript with firefox is MUCH better. –  unixman83 Mar 9 '12 at 3:50
    
Actually, it's very practical from a security standpoint, which is what was asked. NoScript simply disables loading JavaScript by default, except for sites you allow; there are other attack vectors. Without help, that can be tedious and frustrating to get right. The VM acts like a sandbox, allows regular/full browsing and provides a means of easy/quick recovery. No need to use the VM for trusted/known sites if your desktop is locked down, just for new/questionable ones. This thread is also 2 years old... –  Ioan Mar 9 '12 at 16:10
    
Only 5% of real-world attack vectors are successful with scripts off and plugins disabled. i.e. with NoScript. many sites work without scripts turned on. –  unixman83 Mar 10 '12 at 22:45
    
That's fine, I mentioned it wasn't commonly used and takes getting used to. Down voting because you like another solution is incorrect. The answer isn't wrong. You would be better off adding your own answer or up voting another which you may prefer. At least, that's how I understand the voting system to work. –  Ioan Mar 12 '12 at 12:37

in addition to what fluxtendu mentioned above use AddBlock Plus addon in ur firefox...

use a some toold like Threatfire/winpatrol,for real-time behavioral protections

Then you are safe to swim

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.