Skip to content

Instantly share code, notes, and snippets.

@ncherro
Last active December 18, 2015 16:09
Show Gist options
  • Save ncherro/5809330 to your computer and use it in GitHub Desktop.
Save ncherro/5809330 to your computer and use it in GitHub Desktop.
script to recursively removed $zend_framework hacks from php files
#!/bin/bash
# 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 {} \;
@ncherro
Copy link
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