From 792c980e20f780cd07758515045398c2d4e6f21d Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Thu, 24 Mar 2022 01:49:16 -0400 Subject: [PATCH] Fixed plugins. Fixes #144 --- autorecon/default-plugins/nbtscan.py | 2 +- .../default-plugins/virtual-host-enumeration.py | 12 ++++++------ autorecon/main.py | 2 +- pyproject.toml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/autorecon/default-plugins/nbtscan.py b/autorecon/default-plugins/nbtscan.py index 3438a03..9036d02 100644 --- a/autorecon/default-plugins/nbtscan.py +++ b/autorecon/default-plugins/nbtscan.py @@ -14,4 +14,4 @@ class NBTScan(ServiceScan): async def run(self, service): if service.target.ipversion == 'IPv4': - await service.execute('nbtscan -rvh {address} 2>&1', outfile='nbtscan.txt') + await service.execute('nbtscan -rvh {ipaddress} 2>&1', outfile='nbtscan.txt') diff --git a/autorecon/default-plugins/virtual-host-enumeration.py b/autorecon/default-plugins/virtual-host-enumeration.py index b8e0907..96e2561 100644 --- a/autorecon/default-plugins/virtual-host-enumeration.py +++ b/autorecon/default-plugins/virtual-host-enumeration.py @@ -1,6 +1,6 @@ from autorecon.plugins import ServiceScan from shutil import which -import os +import os, random, string class VirtualHost(ServiceScan): @@ -17,10 +17,6 @@ class VirtualHost(ServiceScan): self.match_service_name('^http') self.match_service_name('^nacn_http$', negative_match=True) - def check(self): - if which('gobuster') is None: - self.error('The gobuster program could not be found. Make sure it is installed. (On Kali, run: sudo apt install gobuster)') - async def run(self, service): hostnames = [] if self.get_option('hostname'): @@ -34,6 +30,10 @@ class VirtualHost(ServiceScan): for wordlist in self.get_option('wordlist'): name = os.path.splitext(os.path.basename(wordlist))[0] for hostname in hostnames: - await service.execute('gobuster vhost -k -u {http_scheme}://' + hostname + ':{port}/ -t ' + str(self.get_option('threads')) + ' -w ' + wordlist + ' -r -o "{scandir}/{protocol}_{port}_{http_scheme}_' + hostname + '_vhosts_' + name + '.txt"') + _, stdout, _ = await service.execute('curl -sk -o /dev/null -H "Host: ' + ''.join(random.choice(string.ascii_letters) for i in range(20)) + '.' + hostname + '" {http_scheme}://' + hostname + ':{port}/ -w "%{{size_download}}"') + + size = ''.join(await stdout.readlines()) + + await service.execute('ffuf -u {http_scheme}://' + hostname + ':{port}/ -t ' + str(self.get_option('threads')) + ' -w ' + wordlist + ' -H "Host: FUZZ.' + hostname + '" -fs ' + size + ' -noninteractive -s | tee "{scandir}/{protocol}_{port}_{http_scheme}_' + hostname + '_vhosts_' + name + '.txt"') else: service.info('The target was not a hostname, nor was a hostname provided as an option. Skipping virtual host enumeration.') diff --git a/autorecon/main.py b/autorecon/main.py index 8a5f78a..cf02120 100644 --- a/autorecon/main.py +++ b/autorecon/main.py @@ -17,7 +17,7 @@ from autorecon.io import slugify, e, fformat, cprint, debug, info, warn, error, from autorecon.plugins import Pattern, PortScan, ServiceScan, Report, AutoRecon from autorecon.targets import Target, Service -VERSION = "2.0.17" +VERSION = "2.0.18" if not os.path.exists(config['config_dir']): shutil.rmtree(config['config_dir'], ignore_errors=True, onerror=None) diff --git a/pyproject.toml b/pyproject.toml index 99bb602..ef5fd53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "autorecon" -version = "2.0.17" +version = "2.0.18" description = "A multi-threaded network reconnaissance tool which performs automated enumeration of services." authors = ["Tib3rius"] license = "GNU GPL v3"