View Single Post
  #7 (permalink)  
Old 10-04-2008, 10:38
brighter brighter is offline
Junior Member
 
Join Date: Jan 2007
Posts: 22
Default

Ok. I've got a basic script. It's not perfect. It looks at all html files and replaces all lines that match the matchstring with nothing. It creates backup files with a .bak extension whether a file is altered or not.

Code:
find . -name "*.html" -exec sed -e '/^matchstring*/d' -i.bak {} \;
So, replace matchstring with the malicious line you want removed.

BACKUP ALL FILES FIRST!! just in case something goes wrong.

Edit: And if you want to check other files, just change the *.html to *.whatever, or just use * alone to search all files.
Reply With Quote