-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathSubEvil.py
610 lines (610 loc) · 18.5 KB
/
SubEvil.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
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
"""
███████╗██╗ ██╗██████╗ ███████╗██╗ ██╗██╗██╗
██╔════╝██║ ██║██╔══██╗██╔════╝██║ ██║██║██║
███████╗██║ ██║██████╔╝█████╗ ██║ ██║██║██║
╚════██║██║ ██║██╔══██╗██╔══╝ ╚██╗ ██╔╝██║██║
███████║╚██████╔╝██████╔╝███████╗ ╚████╔╝ ██║███████╗
╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═══╝ ╚═╝╚══════╝
#=====================================================
# Tool Version : V 1.1.1
# Programmer : EvilTwins
# Facebook : @evi1.twins
# Github : @Evi1-Back
#======================================================
"""
from ast import For
import http
from Modules.alienvault import alienvault
from Modules.anubis import anubis
from Modules.binaryedge import binaryedge
from Modules.censys import censys
from Modules.certspotter import certspotter
from Modules.crt import crt
from Modules.dns_bufferover import dns_bufferover
from Modules.dnsdb import dnsdb
from Modules.facebook import facebook
from Modules.hackertarget import hackertarget
from Modules.omnisint import omnisint
from Modules.passivetotal import passivetotal
from Modules.riddler import riddler
from Modules.securitytrails import securitytrails
from Modules.shodan import shodan
from Modules.spyse import spyse
from Modules.sublist3r import sublist3r
from Modules.threatcrowd import threatcrowd
from Modules.threatminer import threatminer
from Modules.tls_bufferover import tls_bufferover
from Modules.urlscan import urlscan
from Modules.virustotal import virustotal
from Modules.whoisxmlapi import whoisxmlapi
from Modules.recondev import recondev
#-----------------------------#
from Lib.Brand import *
from Lib.HttpORHttps import Http
from Lib.HttpORHttps import Https
from Lib.PortScanner import scan_port
#-----------------------------#
from colored import Style , Fore
import time
import sys
import os
import argparse
import threading
from multiprocessing import Pool
import argparse
versions = "V2.1.1"
print(Brand(versions))
#------------------------------#
parser = argparse.ArgumentParser()
parser.add_argument('--domains','-d', type=str,help="Domain name to enumerate it's subdomains")
parser.add_argument("--port-scan",'-p',type=str,help=" " )
parser.add_argument("--random-agent",'-ra',help="Use randomly selected HTTP User-Agent header value",action='store_true')
parser.add_argument("--version",'-v',help="Show program's version number and exit",action='store_true')
parser.add_argument("--http-only","-http",help="Test Domains Ony HTTP",action='store_true')
parser.add_argument("--https-only","-https",help="Test Domains Ony HTTPS",action='store_true')
parser.add_argument("--status-code",'-sc',type=str,help="display response status-code --status-code All or 200 or 404 or 303 etc.." )
parser.add_argument("--title",'-t',help="display page title",action='store_true')
parser.add_argument("--update",help="update SubEvil [Please update the tool every Saturday]",action='store_true')
args = parser.parse_args()
#-----------------------------#
def system():
os.system('cls' if os.name == 'nt' else 'clear')
#--------------------------#
if args.version :
print(f"💯 SubEvil version {versions}")
exit(0)
if args.update:
os.system(f"python Update.py {versions}")
exit(0)
#---------------------------#
system()
print(Brand(versions))
print(f"\n\n\n{Fore.blue}This Tools 💞Help💞 🥷Penetration🥷Testers🥷 in Recon SubDomains For 💣Target💣 {Style.reset} [{Fore.green}SubEvil{Style.reset}] 💯💯")
time.sleep(2)
system()
print(Brand(versions))
#---------------------------#
domains = args.domains
if domains == None:
exit(0)
ListSubdomains = []
print(f"{Fore.red}Target{Style.reset} 💣 {domains} 💣")
if args.http_only and args.https_only:
print(f"{Fore.red} \n You Cannot Use --http-only And --https-Only must choose only one")
exit(0)
if args.status_code or args.title:
if args.https_only or args.http_only:
pass
else:
print(f"{Fore.red} You cannot use --title or --status-code without using --https-Only or --http-Only")
exit(0)
#---------------------------#
def addDomainsAlienvault():
try:
th = alienvault(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsAnubis():
try:
th = anubis(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsBinaryedge():
try:
th = binaryedge(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsCensys():
try:
th = censys(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsCertspotter():
try:
th = certspotter(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsCrt():
try:
th = crt(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsDns_bufferover():
try:
th = dns_bufferover(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsDnsdb():
try:
th = dnsdb(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsFacebook():
try:
th = facebook(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsHackertarget():
try:
th = hackertarget(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsOmnisint():
try:
th = omnisint(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsPassivetotal():
try:
th = passivetotal(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsRiddler():
try:
th = riddler(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsSecuritytrails():
try:
th = securitytrails(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsShodan():
try:
th = shodan(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsSpyse():
try:
th = spyse(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsSublist3r():
try:
th = sublist3r(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsThreatcrowd():
try:
th = threatcrowd(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsThreatminer():
try:
th = threatminer(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsTls_bufferover():
try:
th = tls_bufferover(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsUrlscan():
try:
th = urlscan(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsVirustotal():
try:
th = virustotal(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsWhoisxmlapi():
try:
th = whoisxmlapi(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def addDomainsRecondev():
try:
th = recondev(domains)
for i in th:
if not ListSubdomains.__contains__(i):
ListSubdomains.append(i)
if domains in i:
if "," in i:
s = i.split(",")[0]
print(s)
else:
print(i)
else:
pass
else:
pass
except:
pass
def run():
threading.Thread(addDomainsAlienvault()).start()
threading.Thread(addDomainsAnubis()).start()
threading.Thread(addDomainsBinaryedge()).start()
threading.Thread(addDomainsCensys()).start()
threading.Thread(addDomainsCertspotter()).start()
threading.Thread(addDomainsCrt()).start()
threading.Thread(addDomainsDns_bufferover()).start()
threading.Thread(addDomainsDnsdb()).start()
threading.Thread(addDomainsFacebook()).start()
threading.Thread(addDomainsHackertarget()).start()
threading.Thread(addDomainsOmnisint()).start()
threading.Thread(addDomainsPassivetotal()).start()
threading.Thread(addDomainsRiddler()).start()
threading.Thread(addDomainsSecuritytrails()).start()
threading.Thread(addDomainsShodan()).start()
threading.Thread(addDomainsSpyse()).start()
threading.Thread(addDomainsSublist3r()).start()
threading.Thread(addDomainsThreatcrowd()).start()
threading.Thread(addDomainsThreatminer()).start()
threading.Thread(addDomainsTls_bufferover()).start()
threading.Thread(addDomainsUrlscan()).start()
threading.Thread(addDomainsVirustotal()).start()
threading.Thread(addDomainsWhoisxmlapi()).start()
threading.Thread(addDomainsRecondev()).start()
def Start():
threading.Thread(run()).start()
N = 0
for i in ListSubdomains:
if domains in i:
N+=1
else:
pass
print(f"{Fore.blue}Subdomains Fund{Style.reset} [{N}]")
Start()
if args.http_only:
httponly = True
else:
httponly = False
if args.https_only:
httpsonly = True
else:
httpsonly = False
if args.status_code:
status_code = args.status_code
else:
status_code = False
if args.title:
title = True
else:
title = False
def http_(Target):
Http(Target=Target,HTTP=httponly,Title=title,StatusCode=status_code)
def https_(Target):
Https(Target=Target,HTTPs=httpsonly,Title=title,StatusCode=status_code)
if args.http_only:
pool = Pool(120)
pool.map(http_,ListSubdomains)
pool.close()
pool.join()
else:
pass
if args.https_only:
pool = Pool(120)
pool.map(https_,ListSubdomains)
pool.close()
pool.join()
else:
pass
if args.port_scan:
data = []
for i in ListSubdomains:
data.append(f'{i}:{args.port_scan}')
pool = Pool(40)
pool.map(scan_port, data)
pool.close()
pool.join()