Skip to content

Instantly share code, notes, and snippets.

@ahawthorne
Created April 2, 2012 17:29
Show Gist options
  • Save ahawthorne/2285454 to your computer and use it in GitHub Desktop.
Save ahawthorne/2285454 to your computer and use it in GitHub Desktop.
wordpress hacked. arg.
#!/bin/bash
# MAKE A BACKUP OF THE SITE!
# change directory to webroot
cd /var/www/hackedwordpresssite.com/html
# Get a list of files that contain the string "god_mode_off" and save it to a file
# command switches may differ depending on linux release
find . -type f -iname "*.php" | xargs -I{} grep -il god_mode_off {} > bad.list
# loop through the files in bad.list and perform inline string replacement
for i in `cat bad.list`; do sed -i 's/^.*god_mode_off[^>]*>//g' $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment