Skip to content

Instantly share code, notes, and snippets.

@dbspringer
Created September 23, 2014 01:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbspringer/916ecdf783f8e5087422 to your computer and use it in GitHub Desktop.
Save dbspringer/916ecdf783f8e5087422 to your computer and use it in GitHub Desktop.
Recurse through directories looking for bad functions
#!/usr/bin/env bash
dir="."
if [ $1 ]; then dir=$1; fi
bad_funcs="exec system passthru shell_exec escapeshellarg escapeshellcmd proc_close proc_open dl popen show_source ini_set"
for func in $bad_funcs
do
grep -R --include=*.php $func $dir
done
@dbspringer
Copy link
Author

Takes in base path or assumes '.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment