-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminbusterpro.py
More file actions
330 lines (271 loc) · 12.3 KB
/
adminbusterpro.py
File metadata and controls
330 lines (271 loc) · 12.3 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
#!/usr/bin/env python3
import requests
import subprocess
import signal
import sys
import os
import queue
import argparse
import time
import random
from threading import Thread, Lock
from urllib.parse import urlparse
import urllib3
from pathlib import Path
from termcolor import colored
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
VERSION = "3.0"
AUTHOR = "Hacker Joe"
TEAM = "Grey Hat Hacking"
WORDLIST_FILE = "adminbusterpro.txt" # Using your local wordlist
request_counter = 0
counter_lock = Lock()
USER_AGENTS = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 13_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; rv:125.0) Gecko/20100101 Firefox/125.0",
"Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0"
]
def handle_interrupt(signal, frame):
print(colored("\n[!] Interrupted by user. Exiting...", "red", attrs=["bold"]))
sys.exit(0)
signal.signal(signal.SIGINT, handle_interrupt)
def rainbow_text(text):
colors = ['red', 'yellow', 'green', 'cyan', 'blue', 'magenta']
return ''.join(colored(char, colors[i % len(colors)], attrs=["bold"]) if char != " " else " " for i, char in enumerate(text))
def print_banner():
os.system("clear")
print("\n" + rainbow_text("Admin Panel Finder"))
print(colored(f"\nVersion: {VERSION}", "yellow"))
print(colored(f"Author: {AUTHOR}", "yellow"))
print(colored(f"Team: {TEAM}", "yellow"))
print(colored("Using local wordlist: adminbusterpro.txt", "cyan"))
def print_help():
print_banner()
print(colored("\nUsage: ", "cyan", attrs=["bold"]) + colored("python3 adminbusterpro.py -t example.com", "white"))
print(colored("(Give domain only without brackets or https)\n", "yellow"))
print(colored("Options:", "cyan", attrs=["bold"]))
print(colored(" -h, --help ", "white") + "Show this help message and exit")
print(colored(" -t, --target TARGET ", "white") + "Target domain (e.g., example.com)")
print(colored(" -w, --wordlist FILE ", "white") + "Custom wordlist file (default: magic_admin_paths.txt)")
print(colored(" -th, --threads THREADS ", "white") + "Number of threads (default: 10)")
print(colored(" -ua, --random-agent ", "white") + "Use random realistic User-Agent")
print(colored(" -to, --timeout SECONDS ", "white") + "Request timeout in seconds (default: 5)")
print(colored(" --no-ssl-verify ", "white") + "Disable SSL certificate verification\n")
print(colored("Features:", "cyan", attrs=["bold"]))
print(colored(" • Uses local wordlist (no internet dependency)", "green"))
print(colored(" • Multi-threaded for speed", "green"))
print(colored(" • Color-coded HTTP status responses", "green"))
print(colored(" • Automatic results saving", "green"))
def countdown():
print(colored("\nStarting the scan in:", "cyan", attrs=["bold"]))
for i in range(3, 0, -1):
print(colored(str(i), "cyan", attrs=["bold"]))
time.sleep(1)
print(colored("\n[+] Scan Started!\n", "green", attrs=["bold"]))
def load_admin_paths(wordlist_file=None):
"""Load admin paths from local wordlist file"""
if wordlist_file is None:
wordlist_file = WORDLIST_FILE
# Try multiple possible locations
possible_paths = [
wordlist_file,
f"wordlists/{wordlist_file}",
f"../{wordlist_file}",
f"./{wordlist_file}"
]
for file_path in possible_paths:
if os.path.exists(file_path):
try:
with open(file_path, 'r', encoding='utf-8', errors='ignore') as f:
paths = [line.strip() for line in f if line.strip()]
print(colored(f"[+] Loaded {len(paths)} paths from {file_path}", "green"))
return paths
except Exception as e:
print(colored(f"[!] Error reading {file_path}: {e}", "yellow"))
continue
# If no file found, create a minimal default list
print(colored(f"[!] Wordlist file not found: {wordlist_file}", "red"))
print(colored("[!] Using built-in minimal admin paths list", "yellow"))
default_paths = [
"admin", "administrator", "login", "panel", "cp", "controlpanel",
"wp-admin", "admin.php", "administrator/login", "admin/login"
]
return default_paths
def clean_domain(domain_url):
"""Clean and validate domain input"""
if not domain_url.startswith(('http://', 'https://')):
domain_url = 'https://' + domain_url
parsed = urlparse(domain_url)
domain = parsed.netloc or parsed.path
return domain.replace(":", "_")
def color_for_status(code):
"""Return color based on HTTP status code"""
if code == "200":
return "green"
elif code in ["301", "302", "307", "308"]:
return "cyan"
elif code == "403":
return "yellow"
elif code == "401":
return "magenta"
elif code == "404":
return "red"
else:
return "white"
def scan_url(target_domain, path_queue, results, timeout=5, random_ua=False, verify_ssl=True):
"""Scan a single URL for admin panel"""
global request_counter
while not path_queue.empty():
try:
path = path_queue.get(timeout=1)
except:
break
# Build the URL
if not target_domain.startswith(('http://', 'https://')):
target_domain = 'https://' + target_domain
# Remove trailing slash from domain and leading slash from path
base_domain = target_domain.rstrip('/')
clean_path = path.lstrip('/')
full_url = f"{base_domain}/{clean_path}"
with counter_lock:
request_counter += 1
number = request_counter
# Prepare headers
headers = {}
if random_ua:
headers['User-Agent'] = random.choice(USER_AGENTS)
else:
headers['User-Agent'] = USER_AGENTS[0] # Default Chrome
try:
# Use requests instead of curl for better control
response = requests.get(
full_url,
headers=headers,
timeout=timeout,
verify=verify_ssl,
allow_redirects=True
)
http_code = str(response.status_code)
content_length = len(response.content)
color = color_for_status(http_code)
# Print result with color coding
status_display = colored(f"HTTP {http_code}", color, attrs=["bold"])
print(f"[{number}] {full_url} -> {status_display} [Size: {content_length}]")
# Store successful findings
if http_code in ["200", "301", "302", "307"]:
results.append({
'url': full_url,
'status': http_code,
'size': content_length
})
except requests.exceptions.RequestException as e:
error_msg = str(e)
if "SSL" in error_msg:
error_display = "SSL Error"
elif "timeout" in error_msg.lower():
error_display = "Timeout"
elif "connection" in error_msg.lower():
error_display = "Connection Failed"
else:
error_display = "Request Failed"
print(colored(f"[{number}] {full_url} -> ({error_display})", "red"))
path_queue.task_done()
def admin_panel_finder(target_domain, threads=10, random_ua=False, timeout=5, verify_ssl=True, wordlist_file=None):
"""Main function to find admin panels"""
# Load paths from wordlist
paths = load_admin_paths(wordlist_file)
if not paths:
print(colored("[!] No paths to scan. Exiting.", "red"))
return
# Setup queue
q = queue.Queue()
for path in paths:
q.put(path)
results = []
thread_list = []
# Create results directory
domain_folder = f"results/{clean_domain(target_domain)}"
os.makedirs(domain_folder, exist_ok=True)
output_file = os.path.join(domain_folder, "found_panels.txt")
log_file = os.path.join(domain_folder, "scan_log.txt")
print(colored(f"\n[+] Target: {target_domain}", "cyan"))
print(colored(f"[+] Threads: {threads}", "cyan"))
print(colored(f"[+] Timeout: {timeout}s", "cyan"))
print(colored(f"[+] Paths to scan: {len(paths)}", "cyan"))
print(colored(f"[+] Results will be saved to: {domain_folder}/", "cyan"))
countdown()
# Start threads
for _ in range(threads):
t = Thread(target=scan_url, args=(target_domain, q, results, timeout, random_ua, verify_ssl))
thread_list.append(t)
t.daemon = True
t.start()
# Wait for all threads to complete
try:
q.join()
except KeyboardInterrupt:
print(colored("\n[!] Scan interrupted by user", "red"))
# Print results
if results:
print(colored(f"\n[✓] Found {len(results)} possible admin panels!", "green", attrs=["bold"]))
# Sort results by status code
results.sort(key=lambda x: x['status'])
for result in results:
color = color_for_status(result['status'])
status_display = colored(f"HTTP {result['status']}", color, attrs=["bold"])
print(colored(f" - {result['url']}", "green") + f" -> {status_display}")
# Save results to file
with open(output_file, "w") as f:
f.write(f"Admin Panel Scan Results for {target_domain}\n")
f.write(f"Scan completed: {time.ctime()}\n")
f.write(f"Total paths scanned: {len(paths)}\n")
f.write(f"Admin panels found: {len(results)}\n\n")
for result in results:
f.write(f"{result['url']} -> HTTP {result['status']} [Size: {result['size']}]\n")
# Save full log
with open(log_file, "w") as f:
f.write(f"Full Scan Log for {target_domain}\n")
f.write(f"Scan completed: {time.ctime()}\n")
f.write(f"Threads: {threads}, Timeout: {timeout}s\n")
f.write(f"Total paths: {len(paths)}\n")
f.write(f"Found: {len(results)}\n\n")
f.write("All scanned paths:\n")
for path in paths:
f.write(f"{path}\n")
print(colored(f"\n[+] Results saved to {output_file}", "cyan", attrs=["bold"]))
print(colored(f"[+] Full log saved to {log_file}", "cyan"))
else:
print(colored("\n[!] No admin panels found.", "yellow"))
# Save empty results file
with open(output_file, "w") as f:
f.write(f"Admin Panel Scan Results for {target_domain}\n")
f.write(f"Scan completed: {time.ctime()}\n")
f.write(f"Total paths scanned: {len(paths)}\n")
f.write("Admin panels found: 0\n")
f.write("No admin panels were discovered.\n")
print(colored(f"[+] Results saved to {output_file}", "cyan"))
if __name__ == "__main__":
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("-t", "--target", help="Target domain (e.g., example.com)")
parser.add_argument("-w", "--wordlist", help="Custom wordlist file")
parser.add_argument("-th", "--threads", type=int, default=10, help="Number of threads (default: 10)")
parser.add_argument("-ua", "--random-agent", action="store_true", help="Use random realistic User-Agent")
parser.add_argument("-to", "--timeout", type=int, default=5, help="Request timeout in seconds (default: 5)")
parser.add_argument("--no-ssl-verify", action="store_true", help="Disable SSL certificate verification")
parser.add_argument("-h", "--help", action="store_true", help="Show help message and exit")
ARGS = parser.parse_args()
if ARGS.help or not ARGS.target:
print_help()
sys.exit(0)
print_banner()
# Start the scan
admin_panel_finder(
target_domain=ARGS.target,
threads=ARGS.threads,
random_ua=ARGS.random_agent,
timeout=ARGS.timeout,
verify_ssl=not ARGS.no_ssl_verify,
wordlist_file=ARGS.wordlist
)