From 296fc52047d8011171ee77a6cd5ed31e7c1fec93 Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Thu, 26 Aug 2021 20:14:06 -0400 Subject: [PATCH] Bug Fix Fixed a bug where AutoRecon wouldn't restore the terminal after running the help menu in Bash. --- autorecon.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/autorecon.py b/autorecon.py index 17279ec..b4c7a35 100644 --- a/autorecon.py +++ b/autorecon.py @@ -11,8 +11,6 @@ colorama.init() # Save current terminal settings so we can restore them. terminal_settings = termios.tcgetattr(sys.stdin.fileno()) -# This makes it possible to capture keypresses without and without displaying them. -tty.setcbreak(sys.stdin.fileno()) class Pattern: @@ -1480,9 +1478,6 @@ async def main(): num_initial_targets = max(1, math.ceil(autorecon.config['max_port_scans'] / port_scan_plugin_count)) - verbosity_monitor = keyboard.Listener(on_press=change_verbosity) - verbosity_monitor.start() - start_time = time.time() pending = [] @@ -1492,7 +1487,13 @@ async def main(): i+=1 if i >= num_initial_targets: break - + + # This makes it possible to capture keypresses without and without displaying them. + tty.setcbreak(sys.stdin.fileno()) + + verbosity_monitor = keyboard.Listener(on_press=change_verbosity) + verbosity_monitor.start() + timed_out = False while pending: done, pending = await asyncio.wait(pending, return_when=asyncio.FIRST_COMPLETED, timeout=1)