Bug fixes and feature update.

Added optional check() function for plugins to check pre-requisites, etc. after plugins are fully loaded and options have been parsed.
Fixed bug in recent commit.
This commit is contained in:
Tib3rius 2021-09-04 00:37:37 -04:00
parent 137a848047
commit ba942e2964
5 changed files with 39 additions and 14 deletions

View File

@ -246,8 +246,8 @@ async def service_scan(plugin, service):
# Create variables for fformat references.
address = service.target.address
addressv6 = service.target.address
ipaddress = target.ip
ipaddressv6 = target.ip
ipaddress = service.target.ip
ipaddressv6 = service.target.ip
scandir = service.target.scandir
protocol = service.protocol
port = service.port
@ -265,7 +265,7 @@ async def service_scan(plugin, service):
if service.target.ipversion == 'IPv6':
nmap_extra += ' -6'
if addressv6 == target.ip:
if addressv6 == service.target.ip:
addressv6 = '[' + addressv6 + ']'
ipaddressv6 = '[' + ipaddressv6 + ']'
@ -863,6 +863,12 @@ async def main():
sys.exit(0)
for plugin in autorecon.plugins.values():
for member_name, _ in inspect.getmembers(plugin, predicate=inspect.ismethod):
if member_name == 'check':
plugin.check()
continue
if config['ports']:
ports_to_scan = {'tcp':[], 'udp':[]}
unique = {'tcp':[], 'udp':[]}

View File

@ -73,6 +73,10 @@ class OracleTNScmd(ServiceScan):
def configure(self):
self.match_service_name('^oracle')
def check(self):
if which('tnscmd10g') is None:
error('The tnscmd10g program could not be found. Make sure it is installed. (On Kali, run: sudo apt install tnscmd10g)')
async def run(self, service):
if service.target.ipversion == 'IPv4':
await service.execute('tnscmd10g ping -h {address} -p {port} 2>&1', outfile='{protocol}_{port}_oracle_tnscmd_ping.txt')
@ -88,6 +92,10 @@ class OracleScanner(ServiceScan):
def configure(self):
self.match_service_name('^oracle')
def check(self):
if which('oscanner') is None:
error('The oscanner program could not be found. Make sure it is installed. (On Kali, run: sudo apt install oscanner)')
async def run(self, service):
await service.execute('oscanner -v -s {address} -P {port} 2>&1', outfile='{protocol}_{port}_oracle_scanner.txt')

View File

@ -95,6 +95,18 @@ class DirBuster(ServiceScan):
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
def check(self):
tool = self.get_option('tool')
if tool == 'feroxbuster':
if which('feroxbuster') is None:
error('The feroxbuster program could not be found. Make sure it is installed. (On Kali, run: sudo apt install feroxbuster)')
elif tool == 'gobuster':
if which('gobuster') is None:
error('The gobuster program could not be found. Make sure it is installed. (On Kali, run: sudo apt install gobuster)')
elif tool == 'dirsearch':
if which('dirsearch') is None:
error('The dirsearch program could not be found. Make sure it is installed. (On Kali, run: sudo apt install dirsearch)')
async def run(self, service):
dot_extensions = ','.join(['.' + x for x in self.get_option('ext').split(',')])
for wordlist in self.get_option('wordlist'):
@ -178,12 +190,14 @@ class WkHTMLToImage(ServiceScan):
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
def check(self):
if which('wkhtmltoimage') is None:
error('The wkhtmltoimage program could not be found. Make sure it is installed. (On Kali, run: sudo apt install wkhtmltopdf)')
async def run(self, service):
if which('wkhtmltoimage') is not None:
if service.protocol == 'tcp':
await service.execute('wkhtmltoimage --format png {http_scheme}://{addressv6}:{port}/ {scandir}/{protocol}_{port}_{http_scheme}_screenshot.png')
else:
error('The wkhtmltoimage program could not be found. Make sure it is installed. (On Kali, run: sudo apt install wkhtmltopdf)')
class WPScan(ServiceScan):

View File

@ -25,11 +25,13 @@ class RedisCli(ServiceScan):
def configure(self):
self.match_service_name('^redis$')
def check(self):
if which('redis-cli') is None:
error('The redis-cli program could not be found. Make sure it is installed. (On Kali, run: sudo apt install redis-tools)')
async def run(self, service):
if which('redis-cli') is not None:
_, stdout, _ = await service.execute('redis-cli -p {port} -h {address} INFO', outfile='{protocol}_{port}_redis_info.txt')
if not (await stdout.readline()).startswith('NOAUTH Authentication required'):
await service.execute('redis-cli -p {port} -h {address} CONFIG GET \'*\'', outfile='{protocol}_{port}_redis_config.txt')
await service.execute('redis-cli -p {port} -h {address} CLIENT LIST', outfile='{protocol}_{port}_redis_client-list.txt')
else:
error('The redis-cli program could not be found. Make sure it is installed. (On Kali, run: sudo apt install redis-tools)')

View File

@ -37,12 +37,7 @@ class RPCDump(ServiceScan):
def configure(self):
self.match_service_name(['^msrpc', '^rpcbind', '^erpc'])
if which('impacket-rpcdump') is None:
warn('The impacket-rpcdump program could not be found. Some plugins may fail. (On Kali, run: sudo apt install impacket-scripts)')
async def run(self, service):
if which('impacket-rpcdump') is not None:
if service.protocol == 'tcp':
await service.execute('impacket-rpcdump -port {port} {address}', outfile='{protocol}_{port}_rpc_rpcdump.txt')
else:
error('The impacket-rpcdump program could not be found. (On Kali, run: sudo apt install impacket-scripts)')
if service.protocol == 'tcp':
await service.execute('impacket-rpcdump -port {port} {address}', outfile='{protocol}_{port}_rpc_rpcdump.txt')