Created
May 31, 2012 02:59
-
-
Save samir/2840668 to your computer and use it in GitHub Desktop.
Clean infected php files with eval(base64_decode()) functions - usually in wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -name "*.php" -type f -exec sed -i 's/<?php \/\*\*\/ eval(base64_decode(\"[a-z0-9A-Z\/\+]*\"));?>//g' {} \; | |
# or | |
find . -name "*.php" -type f -exec sed -i 's/<?php \/\*\*\/ eval(base64_decode(\"[^"]*\"));?>//g' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@borgogelli
the -i flag on sed indicates that it will insert the changes into the file. so yes