-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAOSPeTT.py
581 lines (556 loc) · 28.7 KB
/
AOSPeTT.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
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
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# !/usr/bin/python3
from optparse import OptionParser
import subprocess
import re
import os
import json
import requests
from urllib import request
def print_banner():
banner = """
\033[1;36m █████╗ ██████╗ ███████╗██████╗ ███████╗████████╗████████╗\033[0m
\033[1;36m██╔══██╗██╔═══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝\033[0m
\033[1;36m███████║██║ ██║███████╗██████╔╝█████╗ ██║ ██║ \033[0m
\033[1;36m██╔══██║██║ ██║╚════██║██╔═══╝ ██╔══╝ ██║ ██║ \033[0m
\033[1;36m██║ ██║╚██████╔╝███████║██║ ███████╗ ██║ ██║ \033[0m
\033[1;36m╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ \033[0m
#AUTOMATED OPEN SOURCE PENETRATION TESTING TOOL
\033[1;36mRSaadat\033[0m
"""
banner_centered = banner.center(len(max(banner.split("\n"), key=len)))
print(banner_centered)
print_banner()
def getipblock(domain):
def print_banner():
banner = """
\033[1;36m █████╗ ██████╗ ███████╗██████╗ ███████╗████████╗████████╗\033[0m
\033[1;36m██╔══██╗██╔═══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝\033[0m
\033[1;36m███████║██║ ██║███████╗██████╔╝█████╗ ██║ ██║ \033[0m
\033[1;36m██╔══██║██║ ██║╚════██║██╔═══╝ ██╔══╝ ██║ ██║ \033[0m
\033[1;36m██║ ██║╚██████╔╝███████║██║ ███████╗ ██║ ██║ \033[0m
\033[1;36m╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ \033[0m
\033[1;38;2;0;206;209mAOSPeTT is running to Find all IPs\033[0m
\033[1;36mRSaadat\033[0m
"""
banner_centered = banner.center(len(max(banner.split("\n"), key=len)))
print(banner_centered)
print_banner()
"""domainip = subprocess.run(f"ping {domain} -c 1 | grep '64 bytes'", shell=True, capture_output=True, text=True)
result = re.search(r'\d*\.\d*\.\d*\.\d*', str(domainip))
if result:
ip = str(result.group(0))"""
with open('asnfile.json', 'w') as f:
subprocess.run(f"curl -s http://ip-api.com/json/{domain}", shell=True, stdout=f, text=True)
ASNnumber = subprocess.run("cat asnfile.json | jq -r .as | cut -d' ' -f1", shell=True, capture_output=True,
text=True)
ASNnumber = ASNnumber.stdout
print(ASNnumber)
with open('ipbp.txt', 'w') as f:
subprocess.run(f"whois -h whois.radb.net -i origin {ASNnumber}) ", shell=True, stdout=f, text=True)
subprocess.run("cat ipbp.txt | grep -Eo '([0-9.]+{4}/[0-9]+)' | uniq | tee ipblock.txt", shell=True)
subprocess.run(f'mv ipblock.txt ./{domain}/domains/ips', shell=True)
subprocess.run('rm ipbp.txt', shell=True)
subprocess.run('rm asnfile.json', shell=True)
def dirsearch(domain):
directorylist = "/root/Desktop/SecLists/Discovery/Web-Content/combined_directories.txt"
wordlist = "/root/Desktop/SecLists/Discovery/Web-Content/combined_words.txt"
subprocess.run(f"cp ./{domain}/subdomains/live_{domain}.txt .", shell=True)
subprocess.run(f"dirsearch.py -l live_{domain}.txt -x 400-499,500-599 -o dirsearchFile.txt ", shell=True)
subprocess.run("cat dirsearchFile.txt | grep 'htt' | awk '{print $3}' |tee dURL.txt", shell=True)
subprocess.run(f'mv dirsearchFile.txt ./{domain}/subdomains/dirsearch ', shell=True)
subprocess.run(f'mv dURL.txt ./{domain}/subdomains/dirsearch ', shell=True)
subprocess.run(f'rm live_{domain}.txt', shell=True)
subprocess.run(f'rm -rf reports', shell=True)
def taking_screenshots(domain):
def print_banner():
banner = """
\033[1;36m █████╗ ██████╗ ███████╗██████╗ ███████╗████████╗████████╗\033[0m
\033[1;36m██╔══██╗██╔═══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝\033[0m
\033[1;36m███████║██║ ██║███████╗██████╔╝█████╗ ██║ ██║ \033[0m
\033[1;36m██╔══██║██║ ██║╚════██║██╔═══╝ ██╔══╝ ██║ ██║ \033[0m
\033[1;36m██║ ██║╚██████╔╝███████║██║ ███████╗ ██║ ██║ \033[0m
\033[1;36m╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ \033[0m
\033[1;36mAOSPeTT is Running for Tacking Screenshots\033[0m
\033[1;36mRSaadat\033[0m
"""
banner_centered = banner.center(len(max(banner.split("\n"), key=len)))
print(banner_centered)
print_banner()
def dirsearch_screeenshots(domain):
print('Tacking Screenshots: ')
subprocess.run(f"cp ./{domain}/subdomains/dirsearch/dURL.txt /opt/EyeWitness/Python", shell=True)
subprocess.run(
'python3 /opt/EyeWitness/Python/EyeWitness.py -f /opt/EyeWitness/Python/dURL.txt -d /opt/EyeWitness/Python/report',
shell=True)
subprocess.run(f"mv /opt/EyeWitness/Python/report ./{domain}/subdomains/dirsearch/screenshots", shell=True)
subprocess.run(f'rm /opt/EyeWitness/Python/dURL.txt', shell=True)
def subdomain_screenshots(domain):
print('Tacking Screenshots for subdomain: ')
subprocess.run(f"cp ./{domain}/subdomains/live_{domain}.txt /opt/EyeWitness/Python", shell=True)
subprocess.run(
f'python3 /opt/EyeWitness/Python/EyeWitness.py -f /opt/EyeWitness/Python/live_{domain}.txt -d /opt/EyeWitness/Python/report',
shell=True)
subprocess.run(f"mv /opt/EyeWitness/Python/report ./{domain}/subdomains/screenshots", shell=True)
subprocess.run(f'rm /opt/EyeWitness/Python/live_{domain}.txt', shell=True)
subdomain_screenshots(domain)
#dirsearch_screeenshots(domain)
def filecominer():
path = os.getcwd()
os.chdir(path)
finallist = []
def convert_json_to_text():
def read_json_file(file_path):
f = open(file_path)
data = json.load(f)
for i in data:
with open("knockpy.txt", 'a') as f:
if i != '_meta':
f.write(i + '\n')
f.close()
for file in os.listdir():
# Check whether file is in text format or not
if file.endswith(".json"):
file_path = f"{path}/{file}"
read_json_file(file_path)
def combiner():
# will read one file and it will return the value of that
def read_text_file(file_path):
with open(file_path, 'r') as f:
return f.read()
# it will write by reciving value from read_text_file() function.
def write():
with open('final.txt', 'a') as f:
f.write(read_text_file(file_path))
f.close()
# iterate through all file
for file in os.listdir():
# Check whether file is in text format or not
if file.endswith(".txt"):
file_path = f"{path}/{file}"
# call read text file function
read_text_file(file_path)
write()
# will remove the duplicat value form final.txt file.
def removeduplicate():
with open(path + r'/final.txt', 'r') as f:
data = f.read().split('\n')
for i in data:
finallist.append(i)
setfinal = set(finallist)
listfinal = list(setfinal)
with open('without_duplicat.txt', 'a') as f:
for line in listfinal:
if line != "":
f.write(line + '\n')
f.close()
removeduplicate()
# will remove the final file which is useless.
os.remove(path + r'/final.txt')
# os.remove(path + r'\knockpy.txt')
convert_json_to_text()
combiner()
def report(domain):
subprocess.run(f'wc ./{domain}/subdomains/without_duplicat.txt | anew {domain}/reports.txt', shell=True)
subprocess.run(f'wc ./{domain}/subdomains/live_{domain}.txt | anew {domain}/reports.txt', shell=True)
subprocess.run(f'wc ./{domain}/domains/amass{domain}.txt | anew {domain}/reports.txt', shell=True)
subprocess.run(f'wc ./{domain}/subdomains/dirsearch/dURL.txt | anew {domain}/reports.txt', shell=True)
def getsubdomains(domain):
def print_banner():
banner = """
\033[1;36m █████╗ ██████╗ ███████╗██████╗ ███████╗████████╗████████╗\033[0m
\033[1;36m██╔══██╗██╔═══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝\033[0m
\033[1;36m███████║██║ ██║███████╗██████╔╝█████╗ ██║ ██║ \033[0m
\033[1;36m██╔══██║██║ ██║╚════██║██╔═══╝ ██╔══╝ ██║ ██║ \033[0m
\033[1;36m██║ ██║╚██████╔╝███████║██║ ███████╗ ██║ ██║ \033[0m
\033[1;36m╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ \033[0m
\033[1;36mAOSPeTT is Running for collecting All subdomains\033[0m
\033[1;36mRSaadat\033[0m
"""
banner_centered = banner.center(len(max(banner.split("\n"), key=len)))
print(banner_centered)
print_banner()
subprocess.run(f"assetfinder -subs-only {domain} | tee ./{domain}/subdomains/assetfinder{domain}.txt",
shell=True)
subprocess.run(f"sublist3r.py -d {domain} -v -t 200 -o ./{domain}/subdomains/sublister{domain}.txt", shell=True)
#subprocess.run(f"amass intel -d {domain} -whois | tee ./{domain}/domains/amass{domain}.txt", shell=True)
subprocess.run(f"subfinder -d {domain} -o ./{domain}/subdomains/subfinder{domain}.txt", shell=True) # it can accept a list
subprocess.run(f"amass enum -passive -d {domain} -o ./{domain}/subdomains/amassenum{domain}.txt", shell=True)
subprocess.run(f"knockpy.py {domain} -th 200 -o ./{domain}/subdomains/.", shell=True)
def getcrtsh_subdomains(domain):
subdomains = set()
wildcardsubdomains = set()
BASE_URL = f"https://crt.sh/?q={domain}&output=json"
try:
response = requests.get(BASE_URL.format(domain))
if response.ok:
content = response.content.decode('UTF-8')
jsondata = json.loads(content)
for i in range(len(jsondata)):
name_value = jsondata[i]['name_value']
if name_value.find('\n'):
subname_value = name_value.split('\n')
for subname_value in subname_value:
if subname_value.find('*'):
if subname_value not in subdomains:
subdomains.add(subname_value)
else:
if subname_value not in wildcardsubdomains:
wildcardsubdomains.add(subname_value)
except:
pass
for subdomain in subdomains:
with open('crtsh_subdomain.txt', 'a') as f:
f.write(subdomain + '\n')
f.close()
subprocess.run(f"mv crtsh_subdomain.txt ./{domain}/subdomains", shell=True) ##
getcrtsh_subdomains(domain)
def getsecurity_tril_subdomain(domain): # it is the function to get all subdomains from getsecurityTrial website
url = f"https://api.securitytrails.com/v1/domain/{domain}/subdomains"
querystring = {"apikey": "RaTQUD5falorL9Qm4OGJAzyUqSiP1Tc1"}
response = requests.request("GET", url, params=querystring)
# creating json file from url
with open('response.json', 'w') as f:
f.write(response.text)
f.close()
def read_json_file():
listall = []
f = open('response.json')
data = json.load(f)
value = data['meta']['limit_reached']
if value == False:
for i in data['subdomains']:
if i != listall:
listall.append(f'{i}.domain.com')
with open('securitytrails.txt', 'w') as f:
for i in listall:
if 'domain.com' not in i:
f.write(i + '\n')
f.close()
else:
# use defrent API
url = f"https://api.securitytrails.com/v1/domain/{domain}/subdomains"
querystring = {"apikey": "GSNrmfRIHKeLGrrCzApkttafZEUrxIMi"}
response = requests.request("GET", url, params=querystring)
# creating json file from url
with open('response.json', 'w') as f:
f.write(response.text)
f.close()
def read_json_file():
print("from second API")
listall = []
f = open('response.json')
data = json.load(f)
value = data['meta']['limit_reached']
if value == False:
for i in data['subdomains']:
if i != listall:
listall.append(f'{i}.domain.com')
with open('securitytrails.txt', 'w') as f:
for i in listall:
if 'domain.com' not in i:
f.write(i + '\n')
f.close()
else:
print(" you reached 100 search for two api key:"
"https://api.securitytrails.com")
read_json_file()
read_json_file()
os.remove('response.json')
subprocess.run(f"mv securitytrails.txt ./{domain}/subdomains", shell=True) ##
#getsecurity_tril_subdomain(domain)
subprocess.run(f'cp {domain}/subdomains/* .', shell=True)
input(f"IT IS TIME TO ADD THE SUBDOMAIN FROM PORJECTDISCOVERY for {domain}: ")
filecominer()
input("ADD outofscope.txt FILE: ")
oofs = []
inscop = []
if 'outofscope.txt' in os.listdir():
try:
with open('outofscope.txt', 'r') as f:
outofscop = f.read().split('\n')
for i in outofscop:
oofs.append(i)
f.close()
os.remove(path + r'/outofscope.txt')
with open('without_duplicat.txt', 'r') as f:
ins = f.read().split('\n')
for i in ins:
if i not in oofs:
inscop.append(i)
f.close()
os.remove(path + r'/without_duplicat.txt')
with open('without_duplicat.txt', 'w') as f:
for i in inscop:
f.write(i + '\n')
f.close()
except:
pass
subprocess.run(
f'cat without_duplicat.txt| httprobe --prefer-https | sed "s/www.//"| anew livesubdomain.txt',
shell=True)
subprocess.run("cat livesubdomain.txt | awk -F'//' '{print $2}' | tee livesubdomain2.txt", shell=True)
subprocess.run(f"cat livesubdomain2.txt | anew ./{domain}/subdomains/live_{domain}.txt", shell=True)
subprocess.run('rm livesubdomain2.txt',shell=True)
subprocess.run('rm livesubdomain.txt', shell=True)
subprocess.run('rm without_duplicat.txt', shell= True)
subprocess.run(f'rm *.json', shell=True)
subprocess.run(f'rm *.txt', shell=True)
subprocess.run('mv domains/newdomains.txt .', shell=True)
def geturls(domain):
def print_banner():
banner = """
\033[1;36m █████╗ ██████╗ ███████╗██████╗ ███████╗████████╗████████╗\033[0m
\033[1;36m██╔══██╗██╔═══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝\033[0m
\033[1;36m███████║██║ ██║███████╗██████╔╝█████╗ ██║ ██║ \033[0m
\033[1;36m██╔══██║██║ ██║╚════██║██╔═══╝ ██╔══╝ ██║ ██║ \033[0m
\033[1;36m██║ ██║╚██████╔╝███████║██║ ███████╗ ██║ ██║ \033[0m
\033[1;36m╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ \033[0m
\033[1;36mAOSPeTT is Running for getting all Urls of target\033[0m
\033[1;36mRSaadat\033[0m
"""
banner_centered = banner.center(len(max(banner.split("\n"), key=len)))
print(banner_centered)
print_banner()
subprocess.run(f"cp ./{domain}/subdomains/live_{domain}.txt .", shell=True)
subprocess.run(f'cat live_{domain}.txt | waybackurls | tee allurls.txt', shell=True)
subprocess.run(f"mv allurls.txt {domain}/urls", shell=True)
def xss(domain):
def print_banner():
banner = """
\033[1;36m █████╗ ██████╗ ███████╗██████╗ ███████╗████████╗████████╗\033[0m
\033[1;36m██╔══██╗██╔═══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝\033[0m
\033[1;36m███████║██║ ██║███████╗██████╔╝█████╗ ██║ ██║ \033[0m
\033[1;36m██╔══██║██║ ██║╚════██║██╔═══╝ ██╔══╝ ██║ ██║ \033[0m
\033[1;36m██║ ██║╚██████╔╝███████║██║ ███████╗ ██║ ██║ \033[0m
\033[1;36m╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ \033[0m
\033[1;36mAOSPeTT is Running for Checking XSS vulnerability \033[0m
\033[1;36mRSaadat\033[0m
"""
banner_centered = banner.center(len(max(banner.split("\n"), key=len)))
print(banner_centered)
print_banner()
subprocess.run(f"cp ./{domain}/urls/allurls.txt .", shell=True)
subprocess.run(
f"cat allurls.txt | grep '=' | egrep -iv '.(jpg|jpeg|gif|css|tif|tiff|png|ttf|woff|woff2|ico|pdf|svg|txt|js)' | tee filtered.txt",
shell=True)
subprocess.run(
f"cat filtered.txt | kxss | tee kxssoutput.txt | sed 's/=.*/=/' | sed 's/URL: //' | dalfox pipe --waf-evasion | tee volnerable.txt",
shell=True)
subprocess.run(f'mkdir ./{domain}/xss', shell=True)
subprocess.run(f'mv volnerable.txt ./{domain}/xss', shell=True)
subprocess.run(f'mv filtered.txt ./{domain}/xss', shell=True)
subprocess.run(f'mv kxssoutput.txt ./{domain}/xss', shell=True)
subprocess.run(f'rm live_{domain}.txt', shell=True)
def filterurl():
dork2 = [
'=/',
'?next=',
'?target=',
'?url=',
'?rurl=',
'/dest=',
'/destination=',
'?redir=',
'?redirect_uri=',
'?return=',
'?return_path',
'/cgi-bin/redirect.cgi?',
'?checkout_url=',
'?image_url=',
'/out?',
'?continue=',
'?view=',
'/redirect/',
'?go=',
'?redirect=',
'?externallink=',
'?nextURL='
'?dest=',
'?destination=',
'?redirect_url=',
'/redirect/',
'/cgi-bin/redirect.cgi?',
'/out/',
'/out?',
'/login?to=',
'?returnTo=',
'?return_to=',
'?ret',
'Lmage_url=',
'Open=',
'callback=',
'cgi-bin/redirect.cgi',
'cgi-bin/redirect.cgi?',
'checkout=',
'checkout_url=',
'continue=',
'data=',
'dest=',
'destination=',
'dir=',
'domain=',
'feed=',
'file=',
'file_name=',
'file_url=',
'folder=',
'folder_url=',
'forward=',
'from_url=',
'go=',
'goto=',
'host=',
'html=',
'image_url=',
'img_url=',
'load_file=',
'load_url=',
'login?to=',
'login_url=',
'logout=',
'navigation=',
'next=',
'next_page=',
'out=',
'page=',
'page_url=',
'path=',
'port=',
'redir=',
'redirect=',
'redirect_to=',
'redirect_uri=',
'redirect_url=',
'reference=',
'return=',
'returnTo=',
'return_path=',
'return_to=',
'return_url=',
'rt=',
'rurl=',
'show=',
'site=',
'target=',
'to=',
'uri=',
'url=',
'val=',
'validate=',
'view=',
'window=',
'r=',
'=http',
'=/'
'redirecturi=',
'redirect_uri=',
'redirecturl=',
'redirect_uri=',
'return=',
'returnurl=',
'relaystate=',
'forward=',
'forwardurl=',
'forward_url=',
'dest=',
'destination=',
'next=',
'=http'
]
url = []
with open('allurls.txt', 'r') as f:
file = f.read().split('\n')
for line in file:
# linee = unquote(line)
for dor in dork2:
if dor in line:
if line.endswith('///'):
line = line[:-3]
if line not in url:
url.append(line)
elif line.endswith('//'):
line = line[:-2]
if line not in url:
url.append(line)
elif line.endswith('/'):
line = line[:-1]
if line not in url:
url.append(line)
else:
url.append(line)
break
continue
with open('opurl.txt', 'w') as f:
for line in url:
f.write(line + '\n')
f.close()
def openredirect(domain):
def print_banner():
banner = """
\033[1;36m █████╗ ██████╗ ███████╗██████╗ ███████╗████████╗████████╗\033[0m
\033[1;36m██╔══██╗██╔═══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝\033[0m
\033[1;36m███████║██║ ██║███████╗██████╔╝█████╗ ██║ ██║ \033[0m
\033[1;36m██╔══██║██║ ██║╚════██║██╔═══╝ ██╔══╝ ██║ ██║ \033[0m
\033[1;36m██║ ██║╚██████╔╝███████║██║ ███████╗ ██║ ██║ \033[0m
\033[1;36m╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ \033[0m
\033[1;36mAOSPeTT is Running for Tacking OpenRedirect\033[0m
\033[1;36mRSaadat\033[0m
"""
banner_centered = banner.center(len(max(banner.split("\n"), key=len)))
print(banner_centered)
print_banner()
subprocess.run(f"cp ./{domain}/subdomains/live_{domain}.txt .", shell=True)
subprocess.run(f"cp {domain}/urls/allurls.txt .", shell=True)
filterurl()
with open(f'live_{domain}.txt', 'r') as f:
subdomains = f.read().split('\n')
for sub in subdomains:
if sub:
subprocess.run(f"cat /opt/openredscan/text/origionalpayloads.txt|sed 's/test.com/''{sub}''/' | tee /opt/openredscan/text/payloads.txt", shell=True)
subprocess.run(f'cat opurl.txt |grep "{sub}"| while read host do ; do python3 /opt/openredscan/openredacan.py -p /opt/openredscan/text/payloads.txt -u $host ; done |grep "http" | egrep -iv "404|400"| anew openredirectvulnerable.txt', shell=True)
subprocess.run("cat openredirectvulnerable.txt | awk -F ' ' '{print $5}' | sed 's/^://' | tee pureurl.txt", shell=True)
liveurls = []
with open('pureurl.txt', 'r') as f:
urls = f.read().split('\n')
for i in urls:
try:
resp = request.urlopen(i)
if resp.code == 200:
liveurls.append(i)
except:
pass
f.close()
with open('volnerable.txt', 'w') as f:
for i in liveurls:
f.write(i + '\n')
f.close()
subprocess.run(f'mkdir ./{domain}/OR', shell=True)
subprocess.run(f'mv openredirectvulnerable.txt ./{domain}/OR', shell=True)
subprocess.run(f'mv volnerable.txt ./{domain}/OR', shell=True)
subprocess.run(f'rm pureurl.txt', shell=True)
subprocess.run(f"rm live_{domain}.txt", shell=True)
subprocess.run(f"rm allurls.txt", shell=True)
def recon(domain):
if f'{domain}' not in os.listdir():
subprocess.run(
f"mkdir {domain} ./{domain}/subdomains ./{domain}/subdomains/dirsearch ./{domain}/subdomains/screenshots ./{domain}/subdomains/dirsearch/screenshots ./{domain}/domains ./{domain}/domains/ips ./{domain}/urls",
shell=True)
else:
pass
getipblock(domain)
getsubdomains(domain)
dirsearch(domain)
taking_screenshots(domain)
geturls(domain)
xss(domain)
openredirect(domain)
def readdomain():
if 'domains' not in os.listdir():
subprocess.run('mkdir domains', shell=True)
subprocess.run('cat newdomains.txt | anew domains.txt', shell=True)
subprocess.run('mv *.txt domains', shell=True)
with open('domains/domains.txt', 'r') as f:
for line in f:
if not line.isspace():
recon(line.strip())
readdomain()