forked from anouarbensaad/vulnx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvulnx.py
667 lines (635 loc) · 28.2 KB
/
vulnx.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
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
#!/usr/bin/env python
"""
The vulnx main part.
Author: anouarbensaad
Desc : CMS-Detector and Vulnerability Scanner & exploiter
Copyright (c)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function
import sys
import argparse
import re
import os
import socket
import common
import warnings
import signal
import requests
from common.threading import threads
warnings.filterwarnings(action="ignore", message=".*was already imported", category=UserWarning)
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
from common.colors import red, green, bg, G, R, W, Y, G , good , bad , run , info , end , que ,bannerblue2
from common.banner import banner
from common.uriParser import parsing_url as hostd
from common.requestUp import random_UserAgent
from common.output_wr import writelogs as outlogs
##### MODULES
from modules.portChecker import portscan
from modules.wpGrabber import (wp_version,wp_plugin,wp_themes,wp_user)
from modules.jooGrabber import (joo_version,joo_user,joo_template)
from modules.dnsLookup import dnsdumper , domain_info
from modules.wpExploits import( wp_wysija,
wp_blaze,
wp_catpro,
wp_cherry,
wp_dm,
wp_fromcraft,
wp_jobmanager,
wp_showbiz,
wp_synoptic,
wp_shop,
wp_powerzoomer,
wp_revslider,
wp_adsmanager,
wp_inboundiomarketing,
wp_levoslideshow,
wp_adblockblocker,
)
from modules.jooExploits import( com_jce,
com_media,
# com_jdownloads,
# com_jdownloadsb,
com_fabrika,
com_fabrikb,
com_foxcontact,
com_adsmanager,
com_blog,
com_users,
comweblinks,
mod_simplefileupload,
com_jbcatalog,
com_sexycontactform,
com_rokdownloads,
com_extplorer,
com_jwallpapers,
com_facileforms,
)
from modules.prestaExploits import (
columnadverts,
soopabanners,
vtslide,
simpleslideshow,
productpageadverts,
productpageadvertsb,
jro_homepageadvertise,
attributewizardpro,
oneattributewizardpro,
attributewizardpro_old,
attributewizardpro_x,
advancedslider,
cartabandonmentpro,
cartabandonmentpro_old,
videostab,
wg24themeadministration,
fieldvmegamenu,
wdoptionpanel,
pk_flexmenu,
nvn_export_orders,
tdpsthemeoptionpanel,
masseditproduct,
)
#cleaning screen
banner()
def parser_error(errmsg):
print("Usage: python " + sys.argv[0] + " [Options] use -h for help")
print(R + "Error: " + errmsg + W)
sys.exit()
def parse_args():
parser = argparse.ArgumentParser(epilog='\tExample: \r\npython ' + sys.argv[0] + " -u google.com")
parser.error = parser_error
parser._optionals.title = "\nOPTIONS"
parser.add_argument('-u', '--url', help="url target to scan")
parser.add_argument('-D', '--dorks', help='search webs with dorks', dest='dorks' , type=str)
parser.add_argument('-o', '--output', help='specify output directory',required=False)
parser.add_argument('-t', '--timeout', help='http requests timeout', dest='timeout',type=float)
parser.add_argument('-c', '--cms-info', help='search cms info[themes,plugins,user,version..]', dest='cms', choices=['user', 'themes','version','plugins','all'])
parser.add_argument('--threads', help="number of threads", dest='numthread', type=float)
parser.add_argument('-n', '--number-pages', help='search dorks number page limit', dest='numberpage' , type=int)
parser.add_argument('-i', '--input', help='specify input file of domains to scan',dest='input_file' ,required=False)
parser.add_argument('-l','--dork-list', help='list names of dorks exploits',dest='dorkslist',
choices=['wordpress', 'prestashop','joomla','lokomedia','drupal','all'])
parser.add_argument('-p', '--ports', help='ports to scan',
dest='scanports', type=int)
#Switches
parser.add_argument('-e','--exploit', help='searching vulnerability & run exploits',
dest='exploit', action='store_true')
parser.add_argument('-w','--web-info', help='web informations gathering',
dest='webinfo', action='store_true')
parser.add_argument('-d','--domain-info', help='subdomains informations gathering',
dest='domaininfo', action='store_true')
parser.add_argument('--dns', help='dns informations gatherings',
dest='dnsdump', action='store_true')
return parser.parse_args()
vulnresults = set() # results of vulnerability exploits. [success or failed]
grabinfo = set() # return cms_detected the version , themes , plugins , user ..
subdomains = set() # return subdomains & ip.
hostinfo = set() # host info
#args declaration
args = parse_args()
#url arg
url = args.url
#run exploit
exploit = args.exploit
#cms gathering args
cms = args.cms
# web hosting info
webinfo = args.webinfo
# domain info
domaininfo = args.domaininfo
# dorks search.
dorks = args.dorks
dorkslist = args.dorkslist
# timeout
timeout = args.timeout or 3
#thread
numthread = args.numthread or 1
#numberpage
numberpage = args.numberpage or 1
#portscan
scanports = args.scanports or 22
#dns
dnsdump = args.dnsdump
#input_file
input_file = args.input_file
# Disable SSL related warnings
warnings.filterwarnings('ignore')
#method for cms detection
def detect_cms():
lm = url + '/smiley/1.gif'
lm_content = requests.get(lm,headers).text
lm2 = url + '/rss.xml'
lm2_content = requests.get(lm2,headers).text
content=requests.get(url,headers).text
# try:
# joomla #
#joomla searching content to detect.
if re.search(re.compile(r'<script type=\"text/javascript\" src=\"/media/system/js/mootools.js\"></script>|/media/system/js/|com_content|Joomla!'), content):
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s %sCMS :%s Joomla' % (good,W,end))
print ('------------------------------------------------')
#webinfo gathering argument
if webinfo:
webhosting_info(hostinfo)
#domain gatherinargument
if domaininfo:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
if cms == 'version':
print (' %s CMS informations gathering' %(run))
joo_version(url,headers)
print ("-----------------------------------------------")
if cms == 'all':
print (' %s CMS informations gathering' %(run))
joo_version(url,headers)
joo_user(url,headers)
joo_template(url,headers)
print ("-----------------------------------------------")
#port to scan
if scanports:
print (' %s Scanning Ports' %(run))
print (""" %s PORTS %sSTATUS %sPROTO"""%(W,W,W))
portscan(hostd(url),scanports)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
#joomla_exploits imported from folder[./common/joomla_exploits.py]
if exploit:
print (' %s Check Vulnerability' %(run))
print (""" %sNAME %sSTATUS %sSHELL"""%(W,W,W))
com_jce(url,headers)
com_media(url,headers)
#com_jdownloads(url,headers)
# com_jdownloadsb(url,headers)
com_fabrika(url,headers)
com_fabrikb(url,headers)
com_foxcontact(url,headers)
com_adsmanager(url,headers)
com_blog(url,headers)
com_users(url,headers)
comweblinks(url,headers)
mod_simplefileupload(url,headers)
com_jbcatalog(url,headers)
com_sexycontactform(url,headers)
com_rokdownloads(url,headers)
com_extplorer(url,headers)
com_jwallpapers(url,headers)
com_facileforms(url,headers)
# Wordpress #
#wordpress searching content to detect.
elif re.search(re.compile(r'wp-content|wordpress|xmlrpc.php'), content):
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s %sCMS :%s Wordpress' % (good,W,end))
print ('------------------------------------------------')
if webinfo:
webhosting_info(hostinfo)
if domaininfo:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
#wp_grab methods info from (folder)[./common/grapwp.py]
if cms == 'version':
print (' %s CMS informations gathering' %(run))
wp_version(url,headers,grabinfo)
print ("-----------------------------------------------")
if cms == 'themes':
print (' %s CMS informations gathering' %(run))
wp_themes(url,headers,grabinfo)
print ("-----------------------------------------------")
if cms == 'user':
print (' %s CMS informations gathering' %(run))
wp_user(url,headers,grabinfo)
print ("-----------------------------------------------")
if cms == 'plugins':
print (' %s CMS informations gathering' %(run))
wp_plugin(url,headers,grabinfo)
print ("-----------------------------------------------")
if cms == 'all':
print (' %s CMS informations gathering' %(run))
wp_version(url,headers,grabinfo)
wp_themes(url,headers,grabinfo)
wp_user(url,headers,grabinfo)
wp_plugin(url,headers,grabinfo)
print ("-----------------------------------------------")
#port to scan
if scanports:
print (' %s Scanning Ports' %(run))
print (""" %sPORTS %sSTATUS %sPROTO"""%(W,W,W))
portscan(hostd(url),scanports)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
# vulnx -u http://example.com -e | vulnx -u http://example --exploit
if exploit:
print (' %s Check Vulnerability\n' %(run))
print (""" %sNAME %sSTATUS %sSHELL"""%(W,W,W))
#wp_exploit methods from (dolder)[./common/wp_exploits.py]
wp_wysija(url,headers,vulnresults)
wp_blaze(url,headers,vulnresults)
wp_synoptic(url,headers,vulnresults)
wp_catpro(url,headers,vulnresults)
wp_cherry(url,headers,vulnresults)
wp_dm(url,headers,vulnresults)
wp_fromcraft(url,headers,vulnresults)
wp_jobmanager(url,headers,vulnresults)
wp_showbiz(url,headers,vulnresults)
wp_shop(url,headers,vulnresults)
wp_powerzoomer(url,headers,vulnresults)
wp_revslider(url,headers,vulnresults)
wp_adsmanager(url,headers,vulnresults)
wp_inboundiomarketing(url,headers,vulnresults)
wp_adblockblocker(url,headers,vulnresults)
wp_levoslideshow(url,headers,vulnresults)
print ("-----------------------------------------------")
# Drupal #
#drupal searching content to detect.
elif re.search(re.compile(r'Drupal|drupal|sites/all|drupal.org'), content):
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s CMS : Drupal' % (good))
print ('------------------------------------------------')
if webinfo:
webhosting_info(hostinfo)
#domain gatherinargument
if domaininfo:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
if cms == 'version':
print (' %s CMS informations gathering' %(run))
drupal_version()
if scanports:
print (' %s Scanning Ports\n' %(run))
print (""" %s PORTS %sSTATUS %sPROTO"""%(W,W,W))
portscan(hostd(url),scanports)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump ' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
if exploit:
print (' %s Check Vulnerability\n' %(run))
print (""" %sNAME %sSTATUS %sSHELL"""%(W,W,W))
# Prestashop #
#prestashop searching content to detect.
elif re.search(re.compile(r'Prestashop|prestashop'), content):
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s %sCMS :%s Prestashop' % (good,W,end))
print ('------------------------------------------------')
if webinfo:
webhosting_info(hostinfo)
#domain gatherinargument
if domaininfo:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
if cms == 'version':
print (' %s CMS informations gathering' %(run))
prestashop_version()
if scanports:
print (' %s Scanning Ports\n' %(run))
print (""" %s PORTS %sSTATUS %sPROTO"""%(W,W,W))
portscan(hostd(url),scanports)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump ' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
if exploit:
print (' %s Check Vulnerability\n' %(run))
print (""" %sNAME %sSTATUS %sSHELL"""%(W,W,W))
columnadverts(url,headers)
soopabanners(url,headers)
vtslide(url,headers)
simpleslideshow(url,headers)
productpageadverts(url,headers)
productpageadvertsb(url,headers)
jro_homepageadvertise(url,headers)
attributewizardpro(url,headers)
oneattributewizardpro(url,headers)
attributewizardpro_old(url,headers)
attributewizardpro_x(url,headers)
advancedslider(url,headers)
cartabandonmentpro(url,headers)
cartabandonmentpro_old(url,headers)
videostab(url,headers)
wg24themeadministration(url,headers)
fieldvmegamenu(url,headers)
wdoptionpanel(url,headers)
pk_flexmenu(url,headers)
nvn_export_orders(url,headers)
tdpsthemeoptionpanel(url,headers)
masseditproduct(url,headers)
# OpenCart #
#opencart searching content to detect.
elif re.search(re.compile(r'route=product|OpenCart|route=common|catalog/view/theme'), content):
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s CMS : OpenCart' % (good))
print ('------------------------------------------------')
if webinfo:
webhosting_info(hostinfo)
#domain gatherinargument
if domaininfo:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
if cms == 'version':
print (' %s CMS informations gathering' %(run))
if scanports:
print (' %s Scanning Ports\n' %(run))
print (""" %s PORTS %sSTATUS %sPROTO"""%(W,W,W))
portscan(hostd(url),scanports)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump ' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
if exploit:
print (' %s Check Vulnerability\n' %(run))
print (""" %sNAME %sSTATUS %sSHELL"""%(W,W,W))
# Magento #
#magento searching content to detect.
elif re.search(re.compile(r'Log into Magento Admin Page|name=\"dummy\" id=\"dummy\"|Magento'), content):
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s CMS : Magento' % (good))
print ('------------------------------------------------')
if webinfo:
webhosting_info(hostinfo)
#domain gatherinargument
if domaininfo:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
if cms == 'version':
print (' %s CMS informations gathering' %(run))
if scanports:
print (' %s Scanning Ports\n' %(run))
print (""" %s PORTS %sSTATUS %sPROTO"""%(W,W,W))
portscan(hostd(url),scanports)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump ' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
if exploit:
print (' %s Check Vulnerability' %(run))
print (""" %sNAME %sSTATUS %sSHELL"""%(W,W,W))
# Lokomedia #
#lokomedia searching content to detect.
print (' %s Check Vulnerability' %(run))
elif re.search(re.compile(r'image/gif'), lm_content):
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s CMS : Lokomedia' % (good))
print ('------------------------------------------------')
if subdomains:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
print ('------------------------------------------------')
if scanports:
print (' %s Scanning Ports\n' %(run))
print (""" %s PORTS %sSTATUS %sPROTO"""%(W,W,W))
portscan(hostd(url),scanports)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump ' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
print (' %s Check Vulnerability' %(run))
elif re.search(re.compile(r'lokomedia'), lm2_content):
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s CMS : Lokomedia' % (good))
print ('------------------------------------------------')
if subdomains:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
if scanports:
print (' %s Scanning Ports\n' %(run))
print (""" %s PORTS %sSTATUS %sPROTO"""%(W,W,W))
portscan(hostd(url),scanports)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump ' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
print (' %s Check Vulnerability' %(run))
# Unknown #
#no cms detect
else:
print ('\n %s[%sTarget%s]%s => %s%s \n '% (bannerblue2,W,bannerblue2, W, url, end))
print ('------------------------------------------------')
print (' %s looking for cms' % (que))
print (' %s CMS : Unknown' % (bad))
print ('------------------------------------------------')
if webinfo:
webhosting_info(hostinfo)
#domain gatherinargument
if domaininfo:
print (' %s Starting searching for Subdomains' %(run))
domain_info(url)
print ("-----------------------------------------------")
if dnsdump:
print (' %s Starting DNS dump ' %(run))
dnsdumper(url)
print ("-----------------------------------------------")
# except Exception as e:
# print ('%s\n\n error : %s%s' % (R,e,W))
# drupal Version
def drupal_version():
response = requests.get(url,headers).text
regex = 'Drupal \d{0,10}'
regex = re.compile(regex)
try:
matches = regex.findall(response)
if len(matches) > 0 and matches[0] != None and matches[0] != "":
version = matches[0]
print ('%s [+] Drupal Version : %s %s' %(G,version,W))
except Exception as error_:
print('Handling Error : '+ str(error_))
# Prestashop Version
def prestashop_version():
response = requests.get(url,headers).text
regex = 'Prestashop \d{0,9}'
regex = re.compile(regex)
try:
matches = regex.findall(response.text)
if len(matches) > 0 and matches[0] != None and matches[0] != "":
version = matches[0]
return print ('%s [+] Prestashop Version : %s %s' %(G,version,W))
except Exception as error_:
print('Handling Error : '+ str(error_))
# Web Hosting Information
def webhosting_info(hostinfo):
print (' %s Web Hosting Information' % (run))
urldate = "https://input.payapi.io/v1/api/fraud/domain/age/" + hostd(url)
getinfo = requests.get(urldate,headers).text
regex_date = r'Date: (.+?)-(.+?)'
regex_date = re.compile(regex_date)
matches = re.search(regex_date,getinfo)
if matches:
print ( ' %s Domain Created on : %s' % (good,matches.group(1)))
try:
ip = socket.gethostbyname(hostd(url))
print ( ' %s CloudFlare IP : %s' % (good,ip))
ipinfo = "http://ipinfo.io/" + ip + "/json"
getipinfo = requests.get(ipinfo,headers).text
country = re.search(re.compile(r'country\": \"(.+?)\"'),getipinfo)
region = re.search(re.compile(r'region\": \"(.+?)\"'),getipinfo)
latitude = re.search(re.compile(r'latitude: (.+?)'),getipinfo)
longitude = re.search(re.compile(r'longitude\": \"(.+?)\"'),getipinfo)
timezone = re.search(re.compile(r'timezone\": \"(.+?)\"'),getipinfo)
ans = re.search(re.compile(r'ans\": \"(.+?)\"'),getipinfo)
org = re.search(re.compile(r'org\": \"(.+?)\"'),getipinfo)
if country:
print(' %s Country : %s' % (good,country.group(1)))
if region:
print(' %s Region : %s' % (good,region.group(1)))
if latitude:
print(' %s Latitude : %s' % (good,latitude.group(1)))
if longitude:
print(' %s Longitude : %s' % (good,longitude.group(1)))
if timezone:
print(' %s Timezone : %s' % (good,timezone.group(1)))
if ans:
print(' %s Ans : %s' % (good,ans.group(1)))
if org:
print(' %s Org : %s' % (good,org.group(1)))
print ("-----------------------------------------------")
except Exception as parsing_error:
print(' %s Parsing error : %s' % (bad , str(parsing_error)))
# output
output_dir = args.output or 'logs'
if not os.path.exists(output_dir): # if the directory doesn't exist
os.mkdir(output_dir) # create a new directory
data = [ vulnresults, grabinfo, subdomains , hostinfo]
data_names = ['vulnresults', 'grabinfo', 'subdomains' , 'hostinfo']
outlogs(data,data_names,output_dir)
data = {
'vulnresults':list(vulnresults),
'grabinfo':list(grabinfo),
'subdomains':list(subdomains),
}
#clean
def signal_handler(signal,frame):
print("%s(ID: {}) Cleaning up...\n Exiting...".format(signal)%(W))
exit(0)
signal.signal(signal.SIGINT, signal_handler)
#main
if __name__ == "__main__":
if input_file:
with open(input_file,'r') as urls:
u_array = [url.strip('\n') for url in urls]
try:
for url in u_array:
root = url
#url condition entrypoint
if root.startswith('http'):
url = root
else:
url = 'http://'+root
#default headers.
headers = {
'User-Agent' : random_UserAgent(),
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Connection': 'keep-alive',
}
detect_cms()
urls.close()
except Exception as error_:
print('UKNOWN ERROR : '+ str(error_))
if url:
#url condition entrypoint
root = url
if root.startswith('http'):
url = root
else:
url = 'http://'+root
#default headers.
headers = {
'User-Agent' : random_UserAgent(),
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Connection': 'keep-alive',
}
detect_cms()
if dorks:
headers = {
'host' : 'google.com',
'User-Agent' : random_UserAgent(),
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Connection': 'keep-alive',}
from modules.dorksEngine import (searchengine,getdorksbyname,wp_contentdorks)
searchengine(dorks,headers,output_dir,numberpage)
if dorkslist == 'all':
from modules.dorkTable import dorkslist as listall
listall()
if dorkslist == 'wordpress':
from modules.dorkTable import wp_dorkTable as listwp
listwp()
if dorkslist == 'joomla':
from modules.dorkTable import joo_dorkTable as listjoo
listjoo()
if dorkslist == 'prestashop':
from modules.dorkTable import ps_dorkTable as listps
listps()
if dorkslist == 'lokomedia':
from modules.dorkTable import loko_dorkTable as listlm
listlm()
if dorkslist == 'drupal':
from modules.dorkTable import dru_dorkTable as listdru
listdru()