From 37a6b479548868b796758297fdd852522f09be56 Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Fri, 27 Aug 2021 01:29:23 -0400 Subject: [PATCH] Update autorecon.py Fixed potential memory leak. Fixed possible display bug. --- autorecon.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autorecon.py b/autorecon.py index 17279ec..df78fbe 100644 --- a/autorecon.py +++ b/autorecon.py @@ -1507,6 +1507,8 @@ async def main(): for task in done: if autorecon.pending_targets: pending.add(asyncio.create_task(scan_target(Target(autorecon.pending_targets.pop(0), autorecon)))) + if task in pending: + pending.remove(task) port_scan_task_count = 0 for targ in autorecon.scanning_targets: @@ -1528,9 +1530,6 @@ async def main(): except: pass - # Restore original terminal settings. - termios.tcsetattr(sys.stdin, termios.TCSADRAIN, terminal_settings) - if timed_out: cancel_all_tasks(None, None) @@ -1547,6 +1546,9 @@ async def main(): if autorecon.missing_services: warn('{byellow}AutoRecon identified the following services, but could not match them to any plugins based on the service name. Please report these to Tib3rius: ' + ', '.join(autorecon.missing_services) + '{rst}') + # Restore original terminal settings. + termios.tcsetattr(sys.stdin, termios.TCSADRAIN, terminal_settings) + if __name__ == '__main__': signal.signal(signal.SIGINT, cancel_all_tasks) try: