How did I get infected in the first place?

You usually get infected because your security settings are too low.

Here are a number of recommendations that will help tighten them, and which will contribute to making you a less likely victim:

1.) Watch what you download!
Many freeware programs, and P2P programs like Limewire, Frostwire, Bearshare and others are amongst the most notorious, come with an enormous amount of bundled spyware that will eat system resources, slow down your system, clash with other installed software, or just plain crash your browser or even Windows itself.

2.) Go to IE > Tools > Windows Update > Product Updates, and install ALL High-Priority Security Updates listed.
If you're running Windows XP, that of course includes the Service Pack 3! If you suspect your computer is infected with Malware of any type, we advise you to not install SP3 if you don't already have it. You can follow the steps in our Malware and Spyware Cleaning Guide and post the required logs on our Forums to get free Expert help cleaning your machine.
Once you are sure you have a clean system, it is highly recommended to install SP3 to help prevent against future infections.

It's important to always keep current with the latest security fixes from Microsoft.
Install those patches for Internet Explorer, and make sure your installation of Java VM is up-to-date. There are some well known security bugs with Microsoft Java VM which are exploited regularly by browser hijackers.

3.) Open IE and go to Internet Options > Security > Internet, then press "Default Level", then OK. Now press "Custom Level." In the ActiveX section, set the first
two options ("Download signed and unsigned ActiveX controls) to "Prompt", and ("Initialize and Script ActiveX controls not marked as safe") to "Disable".
Also set ("Installation of desktop items"), ("Launching programs and files in an IFRAME"), and ("Navigate sub-frames across different domains") to "Prompt"

Now you will be asked whether you want ActiveX objects to be executed and whether you want software to be installed.
Sites that you know for sure are above suspicion can be moved to the Trusted Zone in Internet Option > Security.

So why is ActiveX so dangerous that you have to increase the security for it?
When your browser runs an activex control, it is running an executable program. It's no different from doubleclicking an exe file on your hard drive.
Would you run just any random file downloaded off a web site without knowing what it is and what it does?

It is also a good idea to install a safer browser such as FireFox

4.) Install Javacool's SpywareBlaster
It will protect you from most spy/foistware in it's database by blocking installation of their ActiveX objects.

Download and install, download the latest updates, and you'll see a list of all spyware programs covered by the program (NOTE: this is NOT spyware found on your computer)

Press "Enable All Protection", and you're done.
The spyware that you told Spywareblaster to set the "kill bit" for won't be a hazard to you any longer.
Although it won't protect you from every form of spyware known to man, it is a very potent extra layer of protection.
Don't forget to check for updates every week or so.

5.) Another excellent program by Javacool we recommend is SpywareGuard.
It provides a degree of real-time protection solution against spyware that is a great addition to SpywareBlaster's protection method.

6.) A highly effective program for malware removal is MalwareBytes' AntiMalware.
Update the free version and scan with it often. It is an excellent tool to have on your side.

7.) Another excellent program we recommend is SuperAntiSpyware.
The free version works well when manually updated and scanned with once per week at least

8.) The MVPS Hosts file replaces your current HOSTS file with one containing well know ad sites etc. Basically, this prevents your computer from connecting to those sites by redirecting them to which is your local computer. This little program packs a powerful punch as it block ads, banners, 3rd party Cookies, 3rd party page counters, web bugs, and many hijackers. For information on how to download and install, please read this tutoria.

9.) McAfee SiteAdvisor adds safety ratings to your browser and search engine results. These alert you to potentially risky sites and help you find safer alternatives.

*It is important to note that all of the above programs/files can be run simultaneously on your system. They will work together in layers, so to speak, to help protect your computer. However, the following suggestions are designed to only run one of each. It is not a good idea to run more than one firewall, and one anti-virus program. Running more than one of these at a time can cause system crashes, high system usage and/or conflicts with each other.*

10.) It is critical that you use a firewall to protect your computer from hackers. We don't recommend the firewall that comes built in to Windows. It doesn't block everything that may try to get in, and the entire firewall is written to the registry. As various kinds of malware hack the Registry in order to disable the Windows firewall, it's far preferable to install one of the excellent third party solutions. Three good ones that are freeware are OnlineArmor, Outpost Firewall Free, and Sunbelt Personal Firewall.

11.) An Anti-Virus product is a necessity. There are many excellent programs that you can purchase. However, we choose to advocate the use of free programs whenever possible. Some very good and easy-to-use free A/V programs are AntiVir Personal, Avast! Free, and Microsoft Security Essentials. It's a good idea to set these to receive automatic updates so you are always as fully protected as possible from the newest virus threats.
NOTE: DO NOT install more than one anti-virus program. They will conflict, and provide less protection, not more.

12.) Finally, after following up on all these recommendations, it is important to scan your computer and make sure all your programs are up-to-date. This will provide you with an insight on how vulnerable you might still be to a number of common exploits.
Download Secunia Personal Software Inspector (PSI) which will scan your computer for outdated programs that may be vulnerable to attack and infection.

Happy safe computing. 🙂

Thanks and Credit for original article to: Tony Klein
(Microsoft MVP, Windows – Security)

Credit for updates and maintenance of this article to: SpySentinel