Slashdot Mirror


How Can I Tell If My Computer Is Part of a Botnet?

ashraya writes "My father (not too computer literate) has a desktop and a laptop both running Windows in his network back in Hyderabad, India. I set up a Linksys router for him to use with his broadband service. For some reason, he reset the config on the Linksys, and connected it up without wireless security, and also with the default admin password for some time. As you would expect, both of the Windows computers got 'slow,' and the desktop stopped connecting to the internet completely for some reason. As I logged in remotely to 'fix' things, I noticed on the Linksys' log that the laptop was making seemingly random connections to high-numbered ports on various IPs. I did an nslookup on the IPs to see that they were all either in Canada or US, with Comcast and other ISP addresses. Is that a sign that the computers were in a botnet? Are the other hosts part of the botnet too? (I have since rebuilt the Windows hosts, and these connections are not happening now. I have also secured the Linksys.)"

13 of 491 comments (clear)

  1. Well the only fool proof way... by ls671 · · Score: 5, Informative

    Well the only fool proof way that I can envision is the following

    1) Plug you father computer into a HUB ( not a switch, unless it has a special port for this usage)

    2) Plug the router into this HUB

    3) Plug a Linux machine into the HUB and use tcpdump to examine traffic.

    This is what security experts do.

    --
    Everything I write is lies, read between the lines.
    1. Re:Well the only fool proof way... by jspenguin1 · · Score: 5, Informative

      You can also use a host with two interfaces and set up bridging or routing with NAT. If you are running custom firmware you can do this straight on the router itself.

    2. Re:Well the only fool proof way... by ls671 · · Score: 5, Informative

      netstat could be modified not to report the botnet connections if you are owned, hence the fool proof solution.

      --
      Everything I write is lies, read between the lines.
    3. Re:Well the only fool proof way... by neowolf · · Score: 5, Informative

      The hard part nowadays (although maybe not a problem in India) is actually finding a HUB. It is very difficult to actually buy a hub anymore, and most "hubs" sold in the US anyway are actually low-end unmanaged switches, so you can't sniff traffic on them.

      In answer to the question though (I'm sure redundant at this point) is: YES- they are probably part of at least one bot-net, and are probably infected with all sorts of other nastiness. The best thing to do is re-secure the wireless router, and the all-too-often-recommended reformat and re-install of Windows. I wouldn't even try to salvage the current installs at this point.

    4. Re:Well the only fool proof way... by endikos · · Score: 5, Informative

      Or they use a "real" switch that has port mirroring, or a passive ethernet tap.

    5. Re:Well the only fool proof way... by sofar · · Score: 5, Informative

      You don't need a HUB at all. Linux bridging allows you to use two ports on a system 'as a HUB', while still providing you with the ability to tcpdump a port on the bridge. You just add both interfaces to your bridge and stick the linux bridge in between the real router and the infected machine. Only thing needed is a linux system with 2 physical ethernet ports.

    6. Re:Well the only fool proof way... by B'Trey · · Score: 4, Informative

      It is nevertheless better to reserve a machine on your network for just this usage. Nothing installed on it but tcpdump and similar tools.

      Or boot from a Linux Live CD.

      Also, some switches support spanning ports, which will allow you to sniff the traffic on another port. Your typical home network dumb switch probably doesn't support this, but if you have temporary access to a higher end switch, it makes such tasks much easier. You can pick up older switches that support this fairly cheap on Ebay, although you probably won't want to spend the money for a one-time usage.

      --

      "The legitimate powers of government extend only to such acts as are injurious to others." Thomas Jefferson.

  2. Proof of Infection? Clean Reinstall by eldavojohn · · Score: 5, Informative

    As you would expect, both of the Windows computers got 'slow', and the desktop stopped connecting to the internet completely for some reason. As I logged in remotely to 'fix' things ...

    Quick question, how did you log into his desktop remotely if it "stopped connecting to the internet completely for some reason?"

    If all you did was reset the hosts file, it will be back sometime. Somewhere, probably in multiple places on that hard drive, is an executable waiting to be run. It's probably infected some inane looking routine Windows system file that occasionally runs and when that happens your host file will magically change again.

    I could recommend you do a netstat but what's the point? Any botnet today would know how to elude that or run as part of a system routine. If the bot is serious enough, your best bet might be to save the data and just do a routine re-install. You know on my parent's WinXP machine, I do that everytime I'm home for christmas. Then I patch it as far as I can over their 56k modem.

    Odds are high your dad's machine is still infected and I would also suspect your machine as being potentially compromised if you connected using Windows remote desktop. Call me overly cautious but I don't take chances with Windows.

    You can run all the programs you want (Bothunter, Symantic, AVG, AdAware, etc.) but in the end there's no guarantee although BotHunter's probably your best bet.

    The best thing to do is educate your dad. If he has a valid copy of Windows, spend time with him to show him how to go to IE and click Tools -> Update Windows then select all updates. Remind him periodically when you talk to him--especially if he does any banking or commerce online!

    --
    My work here is dung.
  3. See what is going on with NETSTAT by (H)elix1 · · Score: 4, Informative

    Fire up a command prompt and type

    netstat -a | find "LISTENING"

    to find out what ports your system is listening to. Running the netstat command will give you all the traffic. Should give you a good idea as to what is happening. (Helps to close all of your 'normal' apps)

  4. If you suspect the router itself by Ilgaz · · Score: 5, Informative

    If I had that kind of suspicion and if it was router itself I was suspicious about, I would simply get the latest stable firmware for that particular model (be careful) and simply reinstall it over the router itself. It would be something like "format and install windows" I wouldn't really backup any settings on that case. Just make sure you know ISP login and pwd. Make sure they work, they haven't been changed at any point or you will end up speaking with Bangalore at 4 AM :)

    A simple,fast port scanner exists at http://www.grc.com/ (shields up!) which really works, ignore Mr. Gibson's weird named inventions like "nano scan" etc. What I know is, it works. Oh also ignore its port 139 or "you aren't stealth" paranoia. 139 is client port and stealth would be good but you won't really die if you have nothing served.

    For clients, don't re invent the wheel. NMAP is there, free and can run under win32 if you need. http://nmap.org/download.html , some instructions exist for detecting current security threats but I didn't really check since it is all OS X here, we have different issues than win32.

  5. Re:Proof of Infection? Clean Reinstall by RetroGeek · · Score: 5, Informative

    Then I patch it as far as I can over their 56k modem.

    Get Autopatcher and update it from a CD BEFORE you connect it to anything.

    --

    - - - - - - - - - - -
    I am a programmer. I am paid to produce syntax not grammar. Deal with it.
  6. Three things to look for. by sgt+scrub · · Score: 5, Informative

    If you are seeing netbios over tcp (port 445) traffic and he is not uploading/downloading files via the "My Network Places" interface he is most likely infected with a trojan.

    If your seeing random high port to random high port traffic (ports 1024 - 65535 connecting to another ports 1024-65535) and he isn't doing P2P then he most likely is infected and the infection is trying to set up the machine as part of a bot net and trying to infect others.

    If you are seeing UDP traffic on a consistent port on his machine to random high ports (1024-65535) on the outside, his machine is an active server in a bot net.

    --
    Having to work for a living is the root of all evil.
  7. Re:Assume it is .. by PsychoSlashDot · · Score: 5, Informative

    All great points, here are mine.

    1.) We are an architecture office which runs AutoCAD problem is this requires Power User group membership in order to run. (also on windows even without admin privs malicious software can infect.

    No, AutoCAD doesn't require Power User membership. What it requires is someone to spend a few minutes to adjust the system to allow it (and pretty much anything else) to run with User perms only. Do a Google search for Filemon and Regmon formerly from SysInternals and now Microsoft free software. Run them (using RunAs since these DO require admin rights) while your users have normal perms. Set them to only show you what ACAD.EXE does. When it craps out (and it will), search the logs for Access Denied. Manually add perms for Users Full Control to the folders and registry keys that it requires. This will take several passes as the program will run better and better each time. Write down what you have to permit, so next time you install on a new machine you'll know what you need.

    Almost none of my hundreds of supported desktops allow users to have admin rights. The ones I'm not PERMITTED to spend the labour tend to get owned periodically. The non-admin systems don't. Really. Since Win2k's release I have yet to have even one system actually get infected. Light damage, yes. Infected, no.

    What... you think admins running Citrix or Terminal Servers just throw their hands up in the air and accept some lazy-ass vendor's word that their software NEEDS admin rights?

    --
    "Oh no... he found the .sig setting."