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
This commit is contained in:
Tib3rius 2021-08-29 00:11:04 -04:00
parent 62db07d099
commit f629f1ca18
1 changed files with 5 additions and 1 deletions

View File

@ -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: