windows - How do I get rid of malicious spyware, malware, viruses or rootkits from my PC?

07
2014-07
  • Questioner

    What should I do if my Windows computer seems to be infected with a virus or malware?

    • What are the symptoms of an infection?
    • What should I do after noticing an infection?
    • What can I do to get rid of it?

    This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible.

    Feel free to add your contributions via edits.

  • Answers
  • Joel Coehoorn

    Here's the thing: Malware in recent years has become both sneakier and nastier:

    Sneakier, because it travels in packs. Subtle malware can hide behind more obvious infections. There are lots of good tools listed in answers here that can find 99% of malware, but there's always that 1% they can't find yet. Mostly, that 1% is stuff that is new: the malware tools can't find it because it just came out and is using some new exploit or technique to hide itself that the tools don't know about yet. The anti-malware tools still have their place, but I'll get to that later.

    Malware also has a short shelf-life. If you're infected, something from that new 1% is actually very likely to be one part of your infection. It won't be the whole infection: just a part of it. Security tools will help you find and remove the more obvious and well-known malware, and most likely remove all of the symptoms (because you can keep digging until you get that far), but they can leave little pieces behind, like a keylogger or rootkit.

    Nastier, in that it won't just show ads, install a toolbar, or use your computer as a zombie anymore. Modern malware is likely to go right for the banking or credit card information. The people building this stuff are motivated by profit, and if they can't steal from you directly, they'll look for something that they can turn around and sell. This might be processing or network resources in your computer, but it might also be your social security number.

    Put these two factors together, and it's no longer worthwhile to even attempt to remove malware from an installed operating system. I used to be very good at removing this stuff, to the point where I made a significant part of my living that way, and I no longer even make the attempt. I'm not saying it can't be done, but I am saying that the risk analysis results have changed: it's just not worth it anymore. There's too much at stake, and it's too easy to get results that only seem to be effective.

    Lots of people will disagree with me on this, but I challenge that they are not weighing consequences of failure strongly enough. Are you willing to wager your life savings, your good credit, even your identity, that you're better at this than crooks who make millions doing this every day? ...'cause if you try to remove malware and then keep running that old system, that's exactly what you're doing.

    I know there are people out there reading this thinking, "Hey, I've removed several infections from various machines and nothing bad ever happened." I suggest you need to add "yet" to the end of that statement. You might be 99% effective, but you only have to be wrong one time, and the consequences of failure are much higher than they once were. You might even have a machine already out there that still has a ticking time bomb inside, just waiting to be activated or waiting for the right information before reporting it back. Even if you have a 100% effective process now, this stuff changes all the time. Remember: you have to be perfect every time; the bad guys only have to get lucky once.

    In summary, it's unfortunate, but if you have a confirmed malware infection, a complete re-pave of the computer should be the first place you turn instead of the last.


    Here's how to accomplish that:

    Before you're infected, make sure you have a way to re-install any purchased software, including the operating system, that does not depend on anything stored on your internal hard disk. For this purpose, that normally just means hanging onto cd/dvds or product keys1, but the operating system may require you to create recovery disks yourself. Don't rely on a recovery partition for this. If you wait until after an infection to ensure you have what you need to re-install, you may find yourself paying for the same software again.

    If you suspect you have mal-ware, look to other answers here. There are a lot of good tools suggested. My only issue is the best way to use them: I only rely on them for the detection. Install and run the tool, but as soon as it finds evidence of a real infection just stop the scan: the tool has done it's job and confirmed your infection.

    Now, at the time of a confirmed infection, take the following steps:

    1. Check your credit and bank accounts. By the time you find out about the infection, real damage may have already been done. Take any steps necessary to secure your cards, bank account, and identity. Change passwords at any web site you accessed from the compromised computer. Do not use the compromised computer to do any of this.
    2. Take a backup of your data (even better if you already have one).
    3. Re-install the operating system using disks shipped with the computer, purchased separately, or the recovery disk you should have created when the computer was new. Make sure the re-install includes a complete re-format of your disk.
    4. Re-install your applications.
    5. Make sure your operating system and software is fully patched and up to date.
    6. Run a complete anti-virus scan to clean the backup from step two.
    7. Restore the backup.

    If done properly, this is likely to take between two and six real hours of your time, spread out over two to three days (or even longer) while you wait for things like apps to install, windows updates to download, or large backup files to transfer... but it's better than finding out later that crooks drained your bank account. Unfortunately, this is something you should do yourself, or a have a techy friend do for you. At a typical consulting rate of around $100/hr, it can be cheaper to buy a new machine than pay a shop to do this. If you have a friend do it for you, do something nice to show your appreciation. Even geeks the love helping you set up new things or fix broken hardware often hate the tedium of clean-up work. It's also best if you take your own backup... your friends aren't going to know where you put what files, or which ones are really important to you. You're in a better position to take a good backup than they are.


    If you absolutely insist, beyond all reason, that you really want to clean your existing install rather than start over, then for the love of God make sure that whatever method you use involves one of the following two procedures:

    • Remove the hard drive and connect it as a guest disk in a different (clean!) computer to run the scan.

    OR

    • Boot from a CD with it's own set of tools running it's own kernel. Make sure the image for this CD was obtained and burned on a clean computer. If necessary, have a friend make the disk for you.

    Under no circumstances should you try to clean an infected operating system using software that is running as a guest process of that compromised operating system. That's just plain dumb.


    Of course, the best way to fix an infection is to avoid it in the first place, and there are some things you can do to help with that:

    1. Keep your system patched. Make sure you promptly install Windows Updates, Adobe Updates, Java Updates, Apple Updates, etc. This is far more important even than anti-virus software, and for the most part it's not that hard, as long as you keep current. Most of those companies have informally settled on all releasing new patches on the same day each month, so if you keep current it doesn't interrupt you that often.
    2. Do not run as administrator by default. In recent versions of Windows, that is as simple as leaving the UAC feature turned on.
    3. Use a good firewall tool. These days the default firewall in Windows is actually good enough. You may want to supplement this layer with something like WinPatrol that helps stop malicious activity on the front end. Windows Defender works in this capacity to some extent as well.
    4. Run current anti-virus software. This is a distant fourth to the first three, as traditional A/V software often just isn't that effective anymore. It's also important to emphasize the "current". You could have the best antivirus software in the world, but if it's not up to date, you may just as well uninstall it. For this reason, I currently recommend Microsoft Security Essentials. There are likely far better scanning engines out there, but Security Essentials will keep itself up to date, without ever risking an expired registration. AVG and AVast also work well in this way. I just can't recommend any anti-virus software you have to actually pay for, because it's just far too common that a paid subscription lapses and you end up with out-of-date definitions.
    5. Avoid warez, pirated software, and pirated movies/videos. This stuff is often injected with malware by the person who cracked or posted it — not always, but often enough to avoid the whole mess. It's part of why the cracker would do this: sometimes they will get a cut of the profits.
    6. Use your head when browsing the web. If something sounds too good to be true, it probably is.

    1 You should also backup your data, but that's really a separate issue: if you're system security was compromised, your backups are likely compromised, too.

  • Seasoned Advice (cooking)

    How can I tell if my PC is infected?

    General symptoms for malware can be anything. The usual are:

    • The machine is slower than normal.
    • Random failures and things happening when they shouldn't (e.g. some new viruses put group policy restrictions on your machine to prevent task manager or other diagnostic programs from running).
    • Task manager shows a high CPU when you think your machine should be idle (e.g. <5%).
    • Adverts popping up at random.
    • Virus warnings popping up from an antivirus you don't remember installing (the antivirus program is a fake and tries to claim you have scary sounding viruses with names like 'bankpasswordstealer.vir'. You're encouraged to pay for this program to clean these).
    • Internet pages redirected or blocked, for example, home pages of AV products or support sites (www.symantec.com, www.avg.com, www.microsoft.com) are redirected to sites filled with adverts, or fake sites promoting bogus anti virus / "helpful" removal tools, or are blocked altogether.
    • Increased startup time, when you have not been installing any applications (or patches)... This one is awkward.
    • Anything out the blue, if you "know" your system, you typically know when something is very wrong.

    How do I get rid of this?

    Using a Live CD

    Since the infected PC's virus scanner might be compromised, it's probably safer to scan the drive from a Live CD. The CD will boot a specialized operating system on your computer, which will then scan the hard drive.

    There are, for example, Avira Antivir Rescue System or ubcd4win). More suggestions can be found at FREE Bootable AntiVirus Rescue CDs Download List such as:

    • Kaspersky Rescue CD
    • BitDefender Rescue CD
    • F-Secure Rescue CD
    • Avira Antivir Rescue Disk
    • Trinity Rescue Kit CD
    • AVG Rescue CD

    Connecting the hard drive to another PC

    If you are connecting the infected hard drive to a clean system in order to scan it, make sure that you update the virus definitions for all the products that you will be using to scan the infected drive. Waiting a week to let the antivirus providers release new virus definitions can improve your chances of detecting all the viruses.

    Make sure your infected system remains disconnected from the internet while it is infected. This will prevent it from being able to download new editions of viruses (among other things).

    Start with a good tool such as Spybot Search and Destroy or Malwarebytes' Anti-Malware and perform a full scan. Also try ComboFix, and SuperAntiSpyware. No single antivirus product will have every virus definition. Using multiple products is key (not for real time protection). If even just one virus remains on the system, it may be able to download and install all the latest editions of new viruses and all the effort so far would have been for nothing.

    Remove suspicious programs from boot

    1. Start up in safe mode.
    2. Use msconfig to determine what programs and services start at boot.
    3. If there are programs/services that are suspicious, remove them from the boot. Else skip to using a live CD.
    4. Restart.
    5. If the symptoms do not go away and/or the program replaces itself at startup, try using a program called Autoruns to find the program, and remove it from there. If your computer cannot start up, Autoruns has a feature where it can be run from a second PC called "Analyse offline PC". Pay especially close attention to the Logon and Scheduled tasks tabs.
    6. If there is still no success in removing the program, and you are sure that it is the cause of your problems, boot into regular mode, and install a tool called Unlocker
    7. Navigate to the location of the file that is that virus, and attempt to use unlocker to kill it. A few things may happen:
      1. The file is deleted, and does not reappear on restart. This is the best case.
      2. The file is deleted, but immediately reappears. In this case, use a program called Process Explorer to find out the program that re-created the file. You will need to delete that program as well.
      3. The file cannot be deleted, unlocker will prompt you to delete it on reboot. Do that, and see if it reappears. If it does, you must have a program in boot that causes that to happen, and re-examine the list of programs that run in boot.

    What to do after restoring

    Now it should be safe (hopefully) to boot into your (previously) infected system. Still, keep your eyes open for signs of infection. A virus can leave changes on a computer that would make it easier to re-infect even after the virus has been removed.

    For example, if a virus changed DNS or proxy settings, your computer would redirect you to fake versions of legitimate websites, so that downloading what appears to be a well-known and trusted program could actually be downloading a virus.

    They could also get your passwords by redirecting you to fake bank account sites or fake email sites. Be sure to check your DNS and proxy settings. In most cases, your DNS should be provided by your ISP or automatically acquired by DHCP. Your proxy settings should be disabled.

    Check your hosts file (\%systemroot%\system32\drivers\etc\hosts) for any suspicious entries and remove them immediately. Also make sure your firewall is enabled and that you have all the latest Windows updates.

    Next, protect your system with a good antivirus. Microsoft Security Essentials is often recommended along with other products.

    What to do if everything fails

    It should be noted that some malware is very good at avoiding scanners. It's possible that once you are infected, it can install rootkits or similar to stay invisible. If things are really bad, the only option is to wipe the disk and reinstall the operating system from scratch. Sometimes a scan using GMER or Kaspersky's TDSS Killer can show you if you have a rootkit.

    You may want to do a few runs of Spybot Search and Destroy. If after three runs it is unable to remove an infestation (and you fail to do it manually) consider a re-install.

    Another suggestion: Combofix is a very powerful removal tool when rootkits prevent other things from running or installing.

    Using multiple scan engines can certainly help to find malwares best hidden, but it's a fastidious task and a good backup/restore strategy will be more efficient and secure.


    Bonus: There is an interesting video series beginning with, "Understanding and Fighting Malware: Viruses, Spyware" with Mark Russinovich, the creator of Sysinternals ProcessExplorer & Autoruns, about malware cleaning.


  • Related Question

    anti virus - Clean up infected computer from viruses
  • ripper234

    Possible Duplicate:
    What to do if my computer is infected by a virus or a malware?

    I have a computer which had AVG Free installed from day one. After several months of operation, it starts detecting viruses and trojans all the time.

    Besides running a full scan, what should I do to clean the computer? Should I install another anti-virus or anti-malware tool (can it help?), or once viruses infect a system the only real solution is a clean format?

    (Lately I've heard of viruses that burn themselves in the BIOS, so a clean format might not always work ... how common is this technique? Should I burn a fresh BIOS as well?)


  • Related Answers
  • Michael Borgwardt

    once viruses infect a system the only real solution is a clean format

    This. Once your system is infected, you cannot trust any program it's running not to be interfered with by the virus - including all antivirus software. Theoretically, you could boot an antivirus system from CD, but even then, you can't be sure that the virus hasn't hidden a copy of itself deep in some executable from where it can reinfect the system.

    Lately I've heard of viruses that burn themselves in the BIOS, so a clean format might not always work ... how common is this technique? Should I burn a fresh BIOS as well?

    Pointless, since you'd be doing so while a hypothetical BIOS-resident virus is running. The only way to be certain would be to remove the BIOS flash chip and rewrite it using dedicated flashing hardware.

    But I think BIOS-resident viruses have so far occurred only as proof-of-concept implementations and not been spotted "in the wild". It sounds nasty but is not actually very attractive to virus writers, since it would have to deal with (at least) dozens of different motherboard families, each with its own proprietary BIOS flashing protocol.

  • kmarsh

    To avoid reinstalling, simply pull your infected hard disk and disinfect it from another (known clean) PC, attaching it either with a USB/IDE/SATA converter or directly on the IDE or SATA as a second drive.

    This absolutely prevents the virus from defending itself, since it isn't running anything on the new host computer. Be sure to avoid auto-run if using a USB adapter.

    I've had complete success with this method with several computers. As for the BIOS virus, I'll believe it when I see it.

  • Tomas Sedovic

    I agree with Michael's answer -- clean install is the only way that really makes sense.

    On a side note, don't install more than one antivirus. They have to dig deep into the operating system and they usually don't play very well with each other.

  • TFM

    In couple of cases I have successfully cleaned up my computer from viruses with the help of Sysinternals' "Autorun", and a good anti-virus software.

    On the following pages you can find comparisons of anti-virus software:

    http://www.freewaregenius.com/2009/04/07/the-best-free-antivirus-a-comparison/

    http://www.sunbelt-software.com/ihs/alex/Results_2D2008m3b_US.htm

    http://virusinfo.info/index.php?page=testseng

    Basically, Avira, Avast, and AVG tops the charts, and the free versions are as competent as the priced versions.

  • lesmana
    Method: A
    

    1) Change you AV(anti-virus) to Avast, Avira or some paid variant (Kapersky). Download you AV of choice before hand and put it on some media if possible.

    2) Before formatting C:\ or whatever drive you XP resides on , you might want to consider the following: do you have any wedding pictures or music files that are important and need to be backed up to some external HD?

    4) If so, back them up first, and then scan the external HD to make sure there is nothing on it, after backing up all the important stuff.

    5) Make sure you have access to all the drivers(sound, video, etc) via online or some CD on hand, cause you will need to re-install a majority of them if XP does not pick some of them up.

    6) Backup this file: wpa.dbl found in C:\windows\system32 . Wpa.dbl allows you to not have to activate your XP again or have issues activating XP, since you already did it, you just copy this file back into the same folder after re-install.

    Method: B (lazyman/I don't want to formact C:\ but have some time on my hands):

    1) Physically remove the HD from the infected computer, and change the jumper settings to slave.

    2) Install in a working PC, preferably one that is not infected with viruses or a Linux or Unix box and mount infected drive.

    3) Use a ton of standalone scanning tools for both malware and viruses to scan the infected HD.

    4) When this is done, switch over to some online tools and do the same thing, scan for malware and viruses.

    [Disclaimer: complete list of some tools I use for this are furnished upon request.]