Skip to content

Instantly share code, notes, and snippets.

@samba
Last active December 17, 2015 08:28
Show Gist options
  • Save samba/5579885 to your computer and use it in GitHub Desktop.
Save samba/5579885 to your computer and use it in GitHub Desktop.
Search for PHP files that call "eval" (that's bad).
#!/bin/sh
BASEDIR="${1:-./}"
listfiles () {
find ${BASEDIR} -type f -print0 | xargs -0 file -i -0 | grep -a "x-php" | cut -d '' -f 1
}
listfiles | xargs grep -l "eval("
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment