From f629f1ca18cf1bd1429656a9ab23ced70b44937e Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Sun, 29 Aug 2021 00:11:04 -0400 Subject: [PATCH] Added compatibility with Nmap-like comments in target files. Nmap allows comments after the IP / hostname using #. Added the ability to detect and strip out these comments instead of failing. Closes #101 --- autorecon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autorecon.py b/autorecon.py index 51923c5..61816e6 100644 --- a/autorecon.py +++ b/autorecon.py @@ -1535,7 +1535,11 @@ async def main(): lines = f.read() for line in lines.splitlines(): line = line.strip() - if line.startswith('#') or len(line) == 0: continue + if line.startswith('#'): continue + match = re.match('([^#]+)#', line) + if match: + line = match.group(1).strip() + if len(line) == 0: continue if line not in raw_targets: raw_targets.append(line) except OSError: