From 0d2da7cc7a33838a3230209cb5703c7a6587941b Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Sat, 28 Aug 2021 09:17:16 -0400 Subject: [PATCH] Bug Fixes & Improvements Fixed bug where AutoRecon would finish but not output the last few lines. Added new pattern to config file. --- autorecon.py | 12 ++++++++++++ config.toml | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/autorecon.py b/autorecon.py index 84ac789..abb966b 100644 --- a/autorecon.py +++ b/autorecon.py @@ -764,6 +764,9 @@ def cancel_all_tasks(signal, frame): # Restore original terminal settings. termios.tcsetattr(sys.stdin.fileno(), termios.TCSADRAIN, terminal_settings) +def timeout(signal, frame): + raise Exception("Function timed out.") + async def start_heartbeat(target, period=60): while True: await asyncio.sleep(period) @@ -1665,11 +1668,20 @@ async def main(): if i >= num_new_targets: break + # The verbosity_monitor.stop() function sometimes seems to block forever. + # Since it will get killed at the end of the program anyway, if it takes + # more than 1 second to work, we'll time it out. + signal.signal(signal.SIGALRM, timeout) + signal.alarm(1) + try: verbosity_monitor.stop() except: pass + # Cancel the alarm. + signal.alarm(0) + if timed_out: cancel_all_tasks(None, None) diff --git a/config.toml b/config.toml index f343a8d..a2b1a3b 100644 --- a/config.toml +++ b/config.toml @@ -1,7 +1,7 @@ # Configure regular AutoRecon options at the top of this file. # verbose = 1 -# max-scans = 1 +# max-scans = 30 # Configure global pattern matching here. [[pattern]] @@ -11,10 +11,19 @@ pattern = 'State: (?:(?:LIKELY\_?)?VULNERABLE)' [[pattern]] pattern = '(?i)unauthorized' +[[pattern]] +description = 'CVE Identified: {match}' +pattern = '(CVE-\d{4}-\d{4,7})' + # Configure global options here. # [global] # username-wordlist = '/usr/share/seclists/Usernames/cirt-default-usernames.txt' # Configure plugin options here. # [dirbuster] -# wordlist = ['/usr/share/seclists/Discovery/Web-Content/common.txt', '/usr/share/seclists/Discovery/Web-Content/big.txt', '/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt'] +# threads = 50 +# wordlist = [ +# '/usr/share/seclists/Discovery/Web-Content/common.txt', +# '/usr/share/seclists/Discovery/Web-Content/big.txt', +# '/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt' +# ]