Skip to content

Commit

Permalink
fix dorks & root err.
Browse files Browse the repository at this point in the history
  • Loading branch information
anouarbensaad committed Apr 18, 2020
1 parent 0d9a86b commit 9c04861
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 75 deletions.
7 changes: 4 additions & 3 deletions modules/exploits/joomla_exploits.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
month= now.strftime('%m')

import os
from common.colors import failexploit , vulnexploit , que , info , good
from common.colors import failexploit , vulnexploit , que , info , good ,run

class JOOExploits(object):

Expand Down Expand Up @@ -479,11 +479,12 @@ def com_facileforms(self):

def exploit_state(self,exploit):
if (exploit['status']):
print(' {} {} {} {}'.format(que,exploit['name'],vulnexploit,exploit['dump_data']))
print(' {0} {1} {2} {3}'.format(que,exploit['name'],vulnexploit,exploit['dump_data']))
else:
print(' {} {} {}'.format(que,exploit['name'],failexploit))
print(' {0} {1} {2}'.format(que,exploit['name'],failexploit))

def jooexploits(self):
print(' {0} Exploits Scan'.format(run))
self.exploit_state(self.com_jce())
self.exploit_state(self.com_media())
self.exploit_state(self.com_fabrika())
Expand Down
7 changes: 4 additions & 3 deletions modules/exploits/prestashop_exploits.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import requests
import re
import os
from common.colors import que,vulnexploit,que,failexploit
from common.colors import que,vulnexploit,que,failexploit,run

class PSExploits(object):

Expand Down Expand Up @@ -577,11 +577,12 @@ def masseditproduct(self):

def exploit_state(self,exploit):
if (exploit['status']):
print(' {} {} {} {}'.format(que,exploit['name'],vulnexploit,exploit['dump_data']))
print(' {0} {1} {2} {3}'.format(que,exploit['name'],vulnexploit,exploit['dump_data']))
else:
print(' {} {} {}'.format(que,exploit['name'],failexploit))
print(' {0} {1} {2}'.format(que,exploit['name'],failexploit))

def psexploits(self):
print(' {0} Exploits Scan'.format(run))
self.exploit_state(self.columnadverts())
self.exploit_state(self.soopabanners())
self.exploit_state(self.vtslide())
Expand Down
7 changes: 4 additions & 3 deletions modules/exploits/wordpress_exploits.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

from __future__ import (absolute_import, division, print_function)
from common.colors import failexploit, vulnexploit, que, info, good
from common.colors import failexploit, vulnexploit, que, info, good,run

import re
import random
Expand Down Expand Up @@ -628,11 +628,12 @@ def json_writer(self):

def exploit_state(self,exploit):
if (exploit['status']):
print(' {} {} {} {}'.format(que,exploit['name'],vulnexploit,exploit['dump_data']))
print(' {0} {1} {2} {3}'.format(que,exploit['name'],vulnexploit,exploit['dump_data']))
else:
print(' {} {} {}'.format(que,exploit['name'],failexploit))
print(' {0} {1} {2}'.format(que,exploit['name'],failexploit))

def wpexploits(self):
print(' {0} Exploits Scan'.format(run))
self.exploit_state(self.wp_wysija())
self.exploit_state(self.wp_blaze())
self.exploit_state(self.wp_synoptic())
Expand Down
60 changes: 31 additions & 29 deletions modules/gathering/host_gathering.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,30 @@ def __init__(self,url,headers=None):
self.headers = headers

def match_info(self,regex,data):
match = re.search(regex, data)
if match:
return dict(
data=match.group(1)
)

match = re.search(regex, data)
if match:
return dict(
data=match.group(1)
)

def match_printer(self,to_match,match):
if match['data']:
print(' {} {} : {}'.format(good,to_match,match))
print(' {0} {1} : {2}'.format(good,to_match,match['data']))

def os_server(self):
print(' {0} OS / Server Information'.format(run))
response = requests.get(self.url, headers=self.headers).headers
try:
if response["server"]:
regx = re.compile(r"(.+) \((.+)\)")
data = regx.search(response["server"])
print(' {} {}Server :{} {}' .format(good, W, end, data.group(1)))
print(' {} {}OS :{} {}' .format(good, W, end, data.group(2)))
try:
print(' {0} {1}Server :{2} {3}' .format(good, W, end, data.group(1)))
print(' {0} {1}OS :{2} {3}' .format(good, W, end, data.group(2)))
except AttributeError:
print(' {0} Cannot Find OS & HostingServer ' .format(bad))
except KeyError:
print(' {} Cannot Match the server headers ' .format(bad))
print(' {0} Cannot Find the server headers ' .format(bad))

def web_host(self):
urldate = "https://input.payapi.io/v1/api/fraud/domain/age/" + hostd(self.url)
Expand All @@ -38,23 +43,20 @@ def web_host(self):
regex_date = re.compile(regex_date)
matches = re.search(regex_date, getinfo)

print(' {} Web Hosting Information'.format(run))

if matches:
print(' {} Domain Created on : {}'.format(good, matches.group(1)))
print(' {0} Web Hosting Information'.format(run))
try:
ip = socket.gethostbyname(hostd(self.url))
print(' {} CloudFlare IP : {}'.format(good, ip))
ipinfo = "http://ipinfo.io/" + ip + "/json"
gather = requests.get(ipinfo, self.headers).text

self.match_printer('Country',self.match_info(r'country\": \"(.+?)\"',gather))
self.match_printer('Region',self.match_info(r'region\": \"(.+?)\"',gather))
self.match_printer('Latitude',self.match_info(r'latitude: (.+?)',gather))
self.match_printer('Longitude',self.match_info(r'longitude\": \"(.+?)\"',gather))
self.match_printer('Timezone',self.match_info(r'timezone\": \"(.+?)\"',gather))
self.match_printer('Ans',self.match_info(r'ans\": \"(.+?)\"',gather))
self.match_printer('Org',self.match_info(r'org\": \"(.+?)\"',gather))

except Exception as parsing_error:
print(' %s Parsing error : %s' % (bad, str(parsing_error)))
if matches:
print(' {0} Domain Created on : {1}'.format(good, matches.group(1)))
ip = socket.gethostbyname(hostd(self.url))
print(' {0} CloudFlare IP : {1}'.format(good, ip))
ipinfo = "http://ipinfo.io/" + ip + "/json"
gather = requests.get(ipinfo, self.headers).text

self.match_printer('Country',self.match_info(r'country\": \"(.+?)\"',gather))
self.match_printer('Region',self.match_info(r'region\": \"(.+?)\"',gather))
self.match_printer('Timezone',self.match_info(r'timezone\": \"(.+?)\"',gather))
self.match_printer('Postal',self.match_info(r'postal\": \"(.+?)\"',gather))
self.match_printer('Org',self.match_info(r'org\": \"(.+?)\"',gather))
self.match_printer('Location',self.match_info(r'loc\": \"(.+?)\"',gather))
except Exception as err:
print(' {0} Parse Error : {1}' .format(bad,err))
42 changes: 5 additions & 37 deletions vulnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,12 @@ def parse_args():
url = args.url
# interactive arugment
cli = args.cli
# run exploit
exploit = args.exploit
# input_file
input_file = args.input_file
# Disable SSL related warnings
warnings.filterwarnings('ignore')

def detection():

instance = CMS(
url,
headers=headers,
Expand All @@ -109,7 +106,6 @@ def detection():
instance.instanciate()

def dork_engine():

if args.dorks:
DEngine = Dork(
exploit=args.dorks,
Expand All @@ -119,13 +115,14 @@ def dork_engine():
DEngine.search()

def dorks_manual():

if args.dorkslist:
DManual = DorkManual(
select=args.dorkslist
)
DManual.list()

def interactive_cli():
print('a')

def signal_handler(signal, frame):
print("%s(ID: {}) Cleaning up...\n Exiting...".format(signal) % (W))
Expand All @@ -142,44 +139,15 @@ def signal_handler(signal, frame):
'Accept-Language': 'en-US,en;q=0.5',
'Connection': 'keep-alive',
}

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.
detection()
urls.close()
except Exception as error_:
print('UKNOWN ERROR : ' + str(error_))

dork_engine()
dorks_manual()
if url:
# url condition entrypoint
root = url
if root.startswith('http'):
if root.startswith('http://'):
url = root
print(url)
elif root.startswith('https'):
url=root.replace('https','http')

print(url)
elif root.startswith('https://'):
url=root.replace('https://','http://')
else:
url = 'http://'+root
print(url)
# 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',
}
detection()

0 comments on commit 9c04861

Please sign in to comment.