mochahochabeachside.com

Tag: Scripts

Removing malicious code with perl and sed…

by on Feb.10, 2009, under Linux, One-liners

Today, I had an instance where a customer's site had been attacked with a code injection affected all of his .php files. In this case, it was an old vBulletin install that had several known exploits on milw0rm (proof you should update often) that caused it.

Fortunately, the code was injected as a single line, and was the same in every file, and had the added benefit of being on the top line of the file.  So, I could use abit of perl to remove it, and then a bit of sed magic to remove the blank line left by Perl (because for some reason, it didn't want to remove the newline).

(continue reading...)

Leave a Comment :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...