Home » Questions » Computers [ Ask a new question ]

Why can I get a virus or trojan from visiting a website?

Why can I get a virus or trojan from visiting a website?

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

Asked by: Guest | Views: 185
Total answers/comments: 2
Guest [Entry]

"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."
Guest [Entry]

"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."