Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: MBR Infection Removals  (Read 6806 times)

0 Members and 1 Guest are viewing this topic.

OpenSource

    Topic Starter


    Beginner

    Thanked: 5
    • Certifications: List
    • Experience: Experienced
    • OS: Windows 7
    MBR Infection Removals
    « on: October 07, 2010, 01:54:34 PM »
    I am curious as to some of the local scanners that the 'malware removal experts' here recommend?  I work for an IT company and generally do about a dozen or so virus removals a week.

    I've been noticing a lot of TDL3 infections going around, installing fake AV software on computers.  I've had about 4 of them in a row lately.  Which local scanners do you use that claim to remove the infection and how do they remove the infection locally while having an infected MBR?  The actual fakeav suites are easy to remove but not the source of the infection.  I've had to take out the hard drive and hook it up to one of our service machines and have had the highest success rate with that.  Turns out that it creates its own virtual file system within the HDD outside of the file system; on the very last sectors of the HDD.

    I'd be curious to hear of some local scanners that would make my life easier, and in the meantime I'm creating a PE disk using WAIK and maybe putting some of my favorites on that.  Not sure if a PE environment would be as effective though since TDL3 inserts serveral API imports and exports to avoid heuristics *shrug* maybe I'm just better off doing those remote scans.

    OpenSource

      Topic Starter


      Beginner

      Thanked: 5
      • Certifications: List
      • Experience: Experienced
      • OS: Windows 7
      Re: MBR Infection Removals
      « Reply #1 on: October 07, 2010, 08:37:01 PM »
      I can see that the moderators have had time to delete a post in which I have given much more sound advice than any 'malware removal specialists' on this site could possibly give (I do this for a living boys and girls, this isn't just a hobby of mine).  How arrogant.  Anyone can download malwarebytes and combofix, lol.  But they have not had time to respond to a discussion in where they explain the mechanics of how a local scanner is able to remove an MBR infected computer.

      Hopefully, there is hope for computerhope.  Removing a rogue AV security suite with combofix is not going to solve the source of the problem because you're just going to be re-infected.  Hijackthis had it's day until Trend Micro took it over.  Now it's useless.  I would recommend GMER at the bare minimum if you're naieve enough to attempt an advanced rootkit removal during normal startup or even safe mode.

      Here is what you do:  Remove the hard drive.  Hook it up to the service machine (with autorun off).  Run MSE.  It's that simple.  It has worked dozens of times, successfully removing all variants of TDL3 that I have encountered, and I do it dozens of times a week without any re-do's coming back.

      My challenge is to find a local environment to remove these viruses; a 'rescue disk' to be more exact.  Something outside of the OS.  I was hoping you 'malware removal specialists' actually had some knowledge about these things.  After reading most of your solutions to these poor people that you are putting through all this trouble for nothing, clearly I was mistaken.

      I apologize for the lack of charity in my post.

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: MBR Infection Removals
      « Reply #2 on: October 08, 2010, 01:01:46 AM »
      I can't really tell, if you are in charge of an IT department or are doing this as a customer-based thing (that is, people bring their PC to you, you fix it, etc) If you are in charge of an IT department, you're simply doing it wrong- you should be simply restoring backup images. That's mostly why I think it's the latter (customer-based), but I'm not 100% sure on that.

      I am curious as to some of the local scanners that the 'malware removal experts' here recommend?  I work for an IT company and generally do about a dozen or so virus removals a week.

      and how do they remove the infection locally while having an infected MBR?
      the MBR is writable while the system is powered on. Rootkits generally have nothing to do with the MBR, it's just common that a rootkit comes with a MBR infection as well.


      Quote
      I've had to take out the hard drive and hook it up to one of our service machines and have had the highest success rate with that.

      Obviously you are running something on the "service machine" to fix it. (Edit: MSE. Wow, that's totally an enterprise solution you have there, kudos) Don't know what that is. Clearly you cannot just plug a drive into a "service machine" and suddenly have success.

      Quote
      Turns out that it creates its own virtual file system within the HDD outside of the file system; on the very last sectors of the HDD.
      This is not particularly unique, either within rootkits or the MBR code itself; additionally, it's not necessarily it's own "file system" as much as it is the malicious loader (which is pretty much the only thing the boot sector can do, is say where the loader is)

      Normally, being a season professional, I'm sure you already know this; but the boot sector pretty much just loads the rest of the boot code from disk. NT's bootloader will load NTLDR, and continue booting using that; DOS' will read io.sys and msdos.sys; Linux will generally load the selected boot loader (these days, this is typically GRUB). A MBR and boot sector infection can easily infect the drive with a boot sector that references otherwise "unused" portions of the disk, rather then creating a physical file like operating systems do for the "legit" final stage loader. Thing is, that loader(in the unused portion of the disk) will need to pass off control to an OS loader; and before that OS loader starts there really isn't a whole lot for this malicious loader to do. It could, I suppose, manually edit the disk to create new infections or something, but that's so messy to do with direct device access I doubt there is even a existing instance of the method.

      Quote
      Not sure if a PE environment would be as effective though since TDL3 inserts serveral API imports and exports to avoid heuristics

      It would be.

      Booting from a PE environment means that no MBR or boot sector code from the hard disk is loaded. Therefore it is a completely separate environment. rootkits are relatively simple; they are merely kernel drivers that are set to "hide" files/registry keys/etc from certain locations. (well, at least, that's one part of what a rootkit does). For example they almost always hook ntcreatefile() to hook access to "their" rootkit files, and essentially return that the file doesn't exist; similar changes are done for all the various file creation and enumeration functions, essentially hiding said files.

      However, hooking said functions requires that said functions exist to be hooked. This means that, in the case of ntcreatefile(), NTDLL.DLL would need to be loaded. NTDLL.DLL isn't loaded until long after the loader code loses control, since loading NTDLL.DLL is part of Boot Phase 1. At this point, nothing of the bootloader is still executable (to my understanding, since the bootloader was run in real mode whereas the processor had been switched to protected mode before), and even if it was there was no way for it to gain control, anyway. (and thus hook functions).

      Now, a kernel mode boot-time driver, on the other hand, can easily hook ntcreatefile(), but such boot-time drivers are all defined in the registry- a registry stored on the hard disk. A Hard disk, that isn't accessed by a PE boot environment for initialization.

      I do this for a living boys and girls, this isn't just a hobby of mine.
      Could have fooled me. Your previous post shows a rather clear misunderstanding of the windows boot process and exactly what infection vectors exist at early boot phases as well as the capability of said vectors.

      Quote
      Anyone can download malwarebytes and combofix, lol.
      Could you quote where anybody has stated otherwise?

      Quote
      But they have not had time to respond to a discussion in where they explain the mechanics of how a local scanner is able to remove an MBR infected computer.
      they're busy. there is a shortage of active malware specialists at the moment. It's nice to see yet another person who has the idea of I am right and the entire industry is wrong of course, by industry I mean free online malware removal. It's certainly not snake-oil, since it's free and that would be pointless; and saying anything like "you get what you pay for" (which, although you haven't said it, was pretty much implied. Also, other people who have come here saying "OMG you are doin it rong!" pretty much say the same thing) is pretty ridiculous, given that people pay them nothing and often leave with much healthier machines, as well as of course forgetting the number of unscrupulous technicians - about 60% of technicians will try to charge for things like replacing the hard drive and/or reinstalling a new OS for something as simple as a moved jumper.

      a "local scanner" (such as GMER, or what-have-you) can easily fix a infected MBR/boot sector a root-kit fixer fixes it by simply rewriting the MBR. *censored*, you can do this with chkdsk /FIXMBR as well as rewriting the boot sector (via recovery console and fixboot). However, this isn't the sole thing that GMER performs.

      You see, as I explained previously, a rootkit consists of Kernel-Mode DLLs that hook various functions; what GMER (and rootkitrevealer as well to some extent, altough RKR is more or less a informational tool rather then a true "scanner" program) does is pretty simple; it detects hooked functions.

      Now the question may arise "but golly, how does it do that detection?"

      Simple! As we all know, (and you know especially, since we're just "boys and girls" and you "do this for a living") every function in a DLL has a specific export address. GMER (and other detectors) essentially go through all the loaded modules and compare their raw DLL imports with the DLL imports specified in the DLL file for any number of common functions (such as the aforementioned NTCreateFile()) the raw DLL imports, in the case of function hooking, will be pointing to something other then the explicit import address specified in the DLL import table. the detection program flags this, but it is hardly indicative of a infection, since AV software also hooks pretty much the same functions. the detector also prints out the name of the new DLL and function that is hooking that function, which is the bit that is most important.

      An oversimplification would be to say that it compares the result of the GetProcAddress() function with the actual DLL import tables, however, this is naive, since GetProcAddress() could itself be being hooked by a kernel mode rootkit to not return data that might incriminate the rootkit- therefore, it's not a trustworthy function. In fact, no API function is really trustable, except for a few core unhookable functions found in ntoskrnl.

      RootKitRevealer works a bit differently, and instead of looking for possibly hidden function hooks, it looks for possibly hidden data (after all, those function hooks are almost certainly in place to hide something). It does this by reading the registry using Raw file accesses and comparing the keys/data from that to the keys/values that are available to the windows API. A lot of legitimate entries may be flagged as "inaccessible to the windows API" one needs to use their better judgement- it's not usually hard to identify registry entries that are used for something malicious (after all, that's why they were hidden).
      it checks files by reading the disk using raw Kernel reads/writes via direct driver calls; it's impossible to hook driver calls (except via DeviceIOCtl, but such an implementation is unlikely to succeed or work very well, given the varied nature of the drivers involved)


      Quote
      Removing a rogue AV security suite with combofix is not going to solve the source of the problem because you're just going to be re-infected.

      you're right. It's an awfully good thing nobody said it would fix the problem, then.

      Quote
        Hijackthis had it's day until Trend Micro took it over.  Now it's useless.  I would recommend GMER at the bare minimum if you're naieve enough to attempt an advanced rootkit removal during normal startup or even safe mode.
      HJT and GMER are wholly unrelated applications. the new standard (in HJT's domain) is probably DDS; Broni actually brought this up a few times that HJT should probably be dumped in favour of DDS. At least, I think it was Broni. Somebody mentioned it. Actually it might have been me, I don't remember.

      Quote
      Here is what you do:  Remove the hard drive.  Hook it up to the service machine (with autorun off).  Run MSE.  It's that simple.  It has worked dozens of times, successfully removing all variants of TDL3 that I have encountered, and I do it dozens of times a week without any re-do's coming back.
      haha... MSE is an excellent scanning program, but your solution is brute-force. It works, but at an incredible cost of your time and the time of the owner of  the machine (more so the former then the latter). Truly if you are going to go to such extraordinary measure you may as well just do a format/install. Now who is oversimplifying the solution? The specialists here have the difficult task of essentially taking the malware off of a machine. What tools they use for this task really has no relevance since clearly your goals are different- clean the machine using the easiest possible route- additionally, a good number of visitors to this site seeking malware help are not going to be able to slave a drive to begin with; That being said, your exact method has been used at least a dozen times that I've witnessed, but only when most other measures fail (brute force is always a last resort in pretty much any problem domain).

      Quote
      My challenge is to find a local environment to remove these viruses; a 'rescue disk' to be more exact.  Something outside of the OS.  I was hoping you 'malware removal specialists' actually had some knowledge about these things. 
      They do. They just don't feel like sharing it, obviously.

      Quote
      After reading most of your solutions to these poor people that you are putting through all this trouble for nothing
      99.9% of the people requesting malware help eventually leave with clean machines. At the moment there is a rather sharp shortage of Specialists (a good number of them have essentially gone idle) this is actually quite a different problem entirely, and solutions are being investigated; however, even so, those requestees they are able to get to in a timely fashion have, from what I can tell, generally been left with clean machines.

      I actually had a stance similar to yours when I first joined the forum, I rambled on about how regedit,RegMon Process Monitor, and other tools can be used easily to remove nearly any kind of infection. Of course, now I know that that is both wrong, as well as out of context, since it's a heck of a lot harder to direct people through regedit to remove stuff, and it's far more dangerous then a tool for the purpose. At least I didn't stand by a "just slave the drive and run MSE" approach.

      I was trying to dereference Null Pointers before it was cool.

      OpenSource

        Topic Starter


        Beginner

        Thanked: 5
        • Certifications: List
        • Experience: Experienced
        • OS: Windows 7
        Re: MBR Infection Removals
        « Reply #3 on: October 08, 2010, 08:18:45 AM »
        "Rootkits generally have nothing to do with the MBR"

        -Enough said, lol.

        "Edit: MSE. Wow, that's totally an enterprise solution you have there, kudos"

        -The entire point is to find a cost-effective, quick solution to the problem.  The other free scanners take long to install, come with advertisements, etc.  You have to look at it from a business perspective where efficiency is key.  So thank you for pointing out your narrow scope of thinking.  Having a simple, economical solution is better than a long complicated process.

        "Could have fooled me. Your previous post shows a rather clear misunderstanding of the windows boot process and exactly what infection vectors exist at early boot phases as well as the capability of said vectors."

        -I had to learn out of necessity.  I don't care about the boot process and the mechanics as long as there is a solution.  Again, thank you for pointing out your tunnel vision.

        "It works, but at an incredible cost of your time and the time of the owner of  the machine "

        -Haha, it takes under a minute to pop out the hard drive and hook it up via usb to a service machine where you can simply run MSE which is already installed.  You clearly need some time out in the field.

        "99.9% of the people requesting malware help eventually leave with clean machines"

        -or so they think.



        By the way, thank you for your informative comments regarding how RKU works vs GMER and also for explaining the PE environment boot process it will get me headed in the right direction.  And I apologize for my condescending remarks.
        « Last Edit: October 08, 2010, 08:28:48 AM by OpenSource »

        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: MBR Infection Removals
        « Reply #4 on: October 08, 2010, 09:13:34 AM »
        -Haha, it takes under a minute to pop out the hard drive and hook it up via usb to a service machine where you can simply run MSE which is already installed. 
        Yes, that works (for some reason I was thinking plugging it in as an internal drive). But, it's not something just anybody can do; a lot of people think that if you open up a computer even when it's off it could kill you (took a lot of convincing to make that one realize that I wasn't risking my life for a few of their documents...) I was thinking more solutions that any old Joe can try; that's sort of what the malware forum here is oriented towards. Obviously, these same folks could get paid service fromfolks like yourself who can quite simply plop the drive in an enclosure and run scans from another machine; for whatever reason thy chose the free route, and making a set of steps/instructions that are easy to understand to people with aa wide variety of computer experience is no easy task; for some, saying to "slave the drive" can often be the same as saying "build a rocket engine"  :-\; I find, personally, when advising my friends/neighbors on such things it's best to start simple; I've tried the "well, Howard, you simply have to slave the drive and scan it from there" and have them somehow manage to slave the drive to another machine and somehow format it, simply because they aren't clear/familiar with the mechanics; that's why the tools used here are more "convenient" for them, since it's really just a set of steps and following the advice of somebody who is familiar with these things. I had the same "OMG u guys are doin it all wrong" type post when I first started... mine was more "you can just use regedit, you noobs" or something stupid like that.

        Quote
        You clearly need some time out in the field.
        I don't do housecalls :P Personally, I find that the malware isn't often the biggest problem, but the owners attempts at removing it themselves; I've had people deleting random system files trying to "debug" (their words) the problem. I think I simply reinstalled windows in that case; the interesting bit is that they were doing that because they saw tracking cookies in their "system" tool (one of those ridiculous Defragmentor/disk scanner/terrible Spyware detector/bad virus scanner combos... like that System Mechanic thing).


        Quote
        By the way, thank you for your informative comments regarding how RKU works vs GMER and also for explaining the PE environment boot process it will get me headed in the right direction.  And I apologize for my condescending remarks.

        You're welcome, a good source of info on the boot process, and other internals and whatnot, can be found in the various editions of the book "Windows Internals". It doesn't clearly earmark pages/entries "malware can insert itself here to commandeer the system", but it's not to hard to consider the possible "attack" vectors, and the book itself documents them quite thoroughly, so it's "easy" (well, theoretically, obviously this isn't going to be something you would want to repeat constantly on customers machines) to consider what areas to inspect. As you noted you're really just out for what works, but maybe it will help you refine your methods or something; It's certainly not disadvantage to know it! :)

        Quote
        -The entire point is to find a cost-effective, quick solution to the problem.  The other free scanners take long to install, come with advertisements, etc.  You have to look at it from a business perspective where efficiency is key.  So thank you for pointing out your narrow scope of thinking.  Having a simple, economical solution is better than a long complicated process.
        True, true, but, MSE isn't 100% effective- no scanner really can be. Since you are slaving these drives could you not use some sort of "bench" machine with an assortment of scanning programs and scan the drive through a number of them? Since you only install them once (to the test machine) you don't have to worry about the crap they try to install (like default checks on the ask toolbar >:(). Although I guess they will still show those annoying popup adverts a lot have "save XXX% on the pro/full version" type stuff. That's annoying.

        I was trying to dereference Null Pointers before it was cool.

        OpenSource

          Topic Starter


          Beginner

          Thanked: 5
          • Certifications: List
          • Experience: Experienced
          • OS: Windows 7
          Re: MBR Infection Removals
          « Reply #5 on: October 08, 2010, 12:45:14 PM »
          "MSE isn't 100% effective- no scanner really can be. Since you are slaving these drives could you not use some sort of "bench" machine with an assortment of scanning programs and scan the drive through a number of them?"

          I actually scan with MSE and superantispyware.  I used to throw malwarebytes in the mix but with the 3 of them running it made the computers reboot for some reason every now and then....very annoying.  Depending on the types of infection the scanners find, i usually run combofix after the remote scans and proceed with spybot, mbam, counterspy, and cclean at the end for good measure.  then windows updates and defrag :)

          By the way I've successfully created a PE disk with WAIK.  I've been loading some utilities on there and so far have only found a squared to be a decent command line scanner.  What would you recommend for a good rootkit remover to run in PE?

          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: MBR Infection Removals
          « Reply #6 on: October 08, 2010, 01:01:07 PM »
          By the way I've successfully created a PE disk with WAIK.  I've been loading some utilities on there and so far have only found a squared to be a decent command line scanner.  What would you recommend for a good rootkit remover to run in PE?

          Cool, Can't really recommend a rootkitremover; I've never had to remove them as a sort of business or "in bulk" (with a lot of machines) so generally I'm able to remove them myself via recovery console and deleting them (at least, with XP, which was the OS I had the last time I had one).

          I think that a-squared implemented a rootkit scanner as part of it's normal scan, but I'm not sure.
          I was trying to dereference Null Pointers before it was cool.