Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
script to recursively removed $zend_framework hacks from php files
# this recursively loops through all files ending in .php, then removes the
# zend framework hack code. tested on Ubuntu using sed v 4.2.1
# best to run this as root so there aren't any permissions issues
find . -type f -name "*.php" -print | xargs sed -i.hacked 's/^<?php $zend_framework="\\x63\\162\\x65.*?>//g'
# now remove the hacked files
find . -type f -name "*.php.hacked" -exec rm -f {} \;

This comment has been minimized.

Copy link
Owner Author

ncherro commented Jun 18, 2013

you can use this to search for hacked files

fgrep -rl --include=*.php '$zend_framework="\x63\162\x65' /path/to/project/root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.