Created
May 31, 2016 22:22
-
-
Save bl4de/f62b0ede49d372abb5ef49093a4e6c8d to your computer and use it in GitHub Desktop.
XSSaminer by @BruteLogic - tool for finding XSS in PHP source code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1) save it as xssaminer | |
# 2) allow execution: chmod +x xssaminer | |
# 3) run it & check usage: ./xssaminer | |
if [ -z $1 ] | |
then | |
echo -e "Usage:\n$0 FILE\n$0 -r FOLDER" | |
exit | |
else | |
f=$1 | |
fi | |
sources=(GET POST REQUEST "SERVER\['PHP" "SERVER\['PATH_" "SERVER\['REQUEST_U") | |
sinks=(echo die print printf print_r var_dump) | |
xssam(){ | |
for i in ${sources[@]} | |
do | |
a=$(grep -in "\$_${i}" $f | grep -o "\$.*=" | sed "s/[ ]\?=//g" | sort -u) | |
for j in ${sinks[@]} | |
do | |
grep --color -in "${j}.*\$_${i}" $f | |
for k in $a | |
do | |
grep --color -in "${j}.*$k" $f | |
done | |
done | |
done | |
} | |
if [ $f != "-r" ] | |
then | |
xssam | |
else | |
for i in $(find $2 -type f -name "*.php") | |
do | |
echo "File: $i" | |
f=$i | |
xssam | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment