the blog

Using find to delete malware on a server

by Carlyn Maw on February 15, 2014, no comments

My host ( let me know that it had found some malicious files on the various websites I host.  Malware can get snuck onto a site like a Cuckoo’s egg, using up resources and decreasing the reputation of domain names in spam filters and search results. I’m still working on properly fixing everything but some my predated sites were ancient html sites with no cgi of any kind that shouldn’t of had updates since 2004 or 2006. Anything more recent could easily be marked as garbage.

With shell access there are some commands that can help remove the too-new files. This will also work on Linux and MacOS computers.

To learn more, Indiana University has a find command tutorial. Also Wayne Pollock’s A Unix/Linux “find” Command Tutorial for more about using exec and other features.

And for the ubernerds, a discussion of the difference between using exec and xargs for processing find results. (exec is more tolerant of funny file names and I was not deleting massive numbers of files…)

Leave a Reply

carlynorama is Stephen Fry proof thanks to caching by WP Super Cache