The Backstory:
I’ve spent the past 6 years working as an engineer at a company whose client-base is primarily made up of SMB (Small to Medium Business). In a perfect world, every business would have an IT staff, IDS/IPS, and well-trained employees who are savvy enough to avoid common infection vectors. As we all know, this certainly isn’t the case, and we have to be prepared to deal with outbreak situations using a minimal amount of time, money, and equipment.
By far the most common infection I see hitting these environments are the mass-mailer worms. Someone opens a harmless-looking email attachment, and within minutes their computer is sending out an endless stream of email with bogus headers. Quite often the infection will spread to other computers on the network. The worst part is that nobody notices anything until the ISP shuts down the account due to abuse claims, and business grinds to a halt. That’s when I receive the panicked phone call.
What Would MacGyver Do?

- Image via Wikipedia
The first instinct many technicians have is to run around to every single computer, scan/remove any virii/malware, then call the ISP and have the connection re-activated. My advice: don’t do this unless you hate efficiency and want the problem to come back. Here’s why:
- You’re flying blind. You have no idea which or how many computers are infected. The first step in any good diagnostic process should be to clearly define the problem.
- It probably wont work. If the infection got past the resident shield of the antivirus software, a manual scan probably won’t find it either.
- You can’t fight a wildfire with a single bucket. Even if you successfully remove the infection from one PC, it can get re-infected while you’re working on other machines.
- Nobody can work, even the uninfected. In a company with a 50% infection ratio, the business is losing twice the amount of productivity that they could be. Time is expensive.
- Your ISP could blacklist you. If you think you’ve removed the worm and you re-activate your internet connection, a single overlooked infection could get you shut down again in short order. Try doing that 2 or 3 times in a row and you’ll find yourself with a very angry Abuse Department on the other end of the line. Permanent blacklisting will be the result and you really don’t want that.
Most small businesses are reluctant to invest in network security until after they get hit, so you’re going to find yourself staring at a couple of unmanaged switches. The router will be consumer-grade (probably a Linksys that someone picked up at the local Big Box) and if there is any kind of firewall in place it will only be capable of blocking inbound traffic. A paperclip and chewing gum might work on TV, but you’re going to need some bigger guns. Upgrading the infrastructure will have to be dealt with later, but there are some simple steps you can take immediately. Please keep in mind that this is just my advice, and not meant to be a definitive guide, but it has worked well in my experience.
First of all, you’ll want to disconnect the data line between the modem and router. Once this is done, call the ISP and tell them that you’ve isolated the infected machines and would like your account re-activated. You want to do this first because it can take a few hours for them to respond to your request, and you want an active connection on standby.

Remember hubs? Now relegated to the dustbin of antiquated hardware, one of these cheap devices can help you isolate the infection in a few minutes flat. When you don’t have access to high-end equipment, putting a hub between the gateway router and internal switches can effectively become a poor man’s port mirroring. I like to use Wireshark (see above image,) and I simply connect my laptop to the hub and tell the software to start monitoring traffic. It’s best to use OS X or some distribution of Linux for this to minimize the chance of catching the virus yourself. Keep an eye on the traffic for things that shouldn’t be there. In the event of a mass-mailer, you’re going to see a lot of outbound SMTP traffic with all kinds of false header info. To zero in on that particular traffic you can apply the following filter:

This will only show packets that are being sent to port 25, which is the default port for SMTP. Now you’ve got an exact list of infected IP addresses, with no ambiguity of the scope of the infection. Use your favorite network scanner (I use Angry IP Scanner) to locate those hosts and literally unplug them from the network. Clear the filter so that you’re once again looking at all network traffic, and watch for anymore weirdness. When it looks good, go ahead and plug the modem back into the router. This part of the process shouldn’t take more than an hour, and you’ll have a good chunk of the company back up and running.
At this point you’ll able to deal with the infected machines on an individual basis, disinfecting and immunizing as necessary. This process varies greatly depending on the infection, so you’ll have to do a little research. It’s important that you keep an eye on Wireshark as you introduce more and more machines to the network so that nothing slips through; you’ll have to start all over again if that happens.
The final step is the most important: don’t stop monitoring after you’ve finished removing the worm. I recommend logging all network traffic for at least 24 hours afterward; if someone turns on an infected machine that you weren’t aware of (or brings in an infected laptop) you must be able to quarantine it immediately.
I’ve followed this process many times and I’ve never had a relapse. You can use all the time and money saved to convince the powers that be to invest in more robust security, and hopefully prevent the situation from recurring the next time someone clicks on something they shouldn’t.
