Everything is Broken

Cleaning a virus off a Samba Share.

One of the problems of running a Samba share on Linux is that occasionally one of the Windows machines accessing it will get a virus, and infect all the files on the share. You can use one of the AV tools to do this of course, (Clam AV, AVG and Kaspersky all have them these days) but they’re pretty slow generally.

I noticed at one client that the virus was putting exe files into directories, with the same name as the containing directory eg.it would create the file /share/Software/Software.exe.

So the first thing to do is to see who is creating them. Here we go …

cd share
ls -al Software
-rw------   1 tom tom     150304 2011-07-13 14:03 Software.exe

OK, so Tom clearly needs a talking to, and his machine needs to be cleared.

Next thing to do is to find out what the virus is. I uploaded a copy to virustotal.com and found out what it was. This will help me to find a tool to clean the machine – the dedicated removal tools are often quicker than the full virus scans.

Now to clean up the server … After looking at a few of these, and realising that there were thousands on the file, I realised that they were all the same size: 150304 bytes long. OK, so we can find all the files in the recursed subdirectories like this.

find share/ -name '*.exe' -size 150304c

And then when we’re satisfied that the results only contain infected files, we can remove them with this:

find share/ -name '*.exe' -size 150304c -exec rm {} \;

Done deal …

This entry was posted on Wednesday, July 13th, 2011 at 2:36 pm and is filed under General IT, Linux, Security. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Bandwidth Saving apt-get upgrade
Spreadsheet Conditional formatting to mark weekends. »

Leave a Reply

CAPTCHA Image
Refresh Image
*
  • Recent Posts

    • Munin, nginx, mysql on Ubuntu 11.04: Great tool. Poorly explained.
    • Ubuntu 11.10, Unity, Gnome 3 and the whole mess
    • Spreadsheet Conditional formatting to mark weekends.
    • Cleaning a virus off a Samba Share.
    • Bandwidth Saving apt-get upgrade
  • Sing for your supper

  • Static

    • About
    • Privacy Policy
  • Tags

    apathy apple calendar chkconfig collanos cross-platform eee evolution firmware google grub hotspot id card lightning Linux Mandriva notebook partitioning pclinuxos pclinuxos 2008 Philippines power management re-install sane scanner scheduleworld script Security slow sysv-rc-conf thinkpad thunderbird trust ubuntu ultraportable usb virtualisation vmware vpn wifi wireless workspace sharing xsane yahoo zombie
  • Blogroll

    • Datalude
    • Digital Life
    • Engage the World
  • Archives

    • January 2012
    • October 2011
    • August 2011
    • July 2011
    • March 2011
    • January 2011
    • May 2010
    • April 2010
    • March 2010
    • November 2009
    • October 2009
    • June 2009
    • May 2009
    • April 2009
    • February 2009
    • January 2009
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • April 2008
    • March 2008
    • February 2008

Everything is Broken runs on WordPress. Theme by Bob. All content Copyright © Datalude 2008+.