Skip to content

Commit

Permalink
Added ability to override unresolvable hosts failure.
Browse files Browse the repository at this point in the history
Using --disable-sanity-checks will allow AutoRecon to run even if target(s) were unresolvable (one or more targets must be valid however).
Added a new plugin for ajp.
  • Loading branch information
Tib3rius committed Nov 29, 2022
1 parent da718ce commit c67909f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion autorecon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

config = {
'protected_classes': ['autorecon', 'target', 'service', 'commandstreamreader', 'plugin', 'portscan', 'report', 'servicescan', 'global', 'pattern'],
'service_exceptions': ['mc-nmf', 'ncacn_http', 'smux', 'status', 'tcpwrapped', 'unknown'],
'service_exceptions': ['infocrypt', 'mc-nmf', 'ncacn_http', 'smux', 'status', 'tcpwrapped', 'unknown'],
'config_dir': config_dir,
'global_file': None,
'ports': None,
Expand Down
14 changes: 14 additions & 0 deletions autorecon/default-plugins/nmap-ajp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from autorecon.plugins import ServiceScan

class NmapAJP(ServiceScan):

def __init__(self):
super().__init__()
self.name = 'Nmap AJP'
self.tags = ['default', 'safe', 'ajp']

def configure(self):
self.match_service_name(['^ajp13'])

async def run(self, service):
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(ajp-* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_ajp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_ajp_nmap.xml" {address}')
11 changes: 8 additions & 3 deletions autorecon/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from datetime import datetime

try:
import appdirs, colorama, toml, unidecode
import appdirs, colorama, impacket, requests, toml, unidecode
from colorama import Fore, Style
except ModuleNotFoundError:
print('One or more required modules was not installed. Please run or re-run: ' + ('sudo ' if os.getuid() == 0 else '') + 'python3 -m pip install -r requirements.txt')
Expand All @@ -17,7 +17,7 @@
from autorecon.plugins import Pattern, PortScan, ServiceScan, Report, AutoRecon
from autorecon.targets import Target, Service

VERSION = "2.0.28"
VERSION = "2.0.29"

if not os.path.exists(config['config_dir']):
shutil.rmtree(config['config_dir'], ignore_errors=True, onerror=None)
Expand Down Expand Up @@ -1318,6 +1318,7 @@ def unknown_help():
error('The target file ' + args.target_file + ' could not be read.')
sys.exit(1)

unresolvable_targets = False
for target in raw_targets:
try:
ip = ipaddress.ip_address(target)
Expand Down Expand Up @@ -1397,8 +1398,12 @@ def unknown_help():

autorecon.pending_targets.append(Target(target, ip, 'IPv6', 'hostname', autorecon))
except socket.gaierror:
unresolvable_targets = True
error(target + ' does not appear to be a valid IP address, IP range, or resolvable hostname.')
errors = True

if not args.disable_sanity_checks and unresolvable_targets == True:
error('AutoRecon will not run if any targets are invalid / unresolvable. To override this, re-run with the --disable-sanity-checks option.')
errors = True

if len(autorecon.pending_targets) == 0:
error('You must specify at least one target to scan!')
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "autorecon"
version = "2.0.28"
version = "2.0.29"
description = "A multi-threaded network reconnaissance tool which performs automated enumeration of services."
authors = ["Tib3rius"]
license = "GNU GPL v3"
Expand Down

0 comments on commit c67909f

Please sign in to comment.