diff options
author | alexej996 <aleksej@spidermail.tk> | 2018-11-03 22:32:40 +0100 |
---|---|---|
committer | alexej996 <aleksej@spidermail.tk> | 2018-11-03 22:32:40 +0100 |
commit | d3c624c601ed0ad863045ed3057eb2bf2e8dd1d9 (patch) | |
tree | b31b97921ec554639db08c83956801895dce793b | |
parent | 6aee72b405362d42511f749100f28d7c863e4096 (diff) |
host value checking
-rwxr-xr-x | tmap | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -104,11 +104,19 @@ def main(): ## Scan each host in HOSTS list for h in HOSTS: if len(h.split("/")) == 2: - ips = IPv4Network(unicode(h)) - for i in ips.hosts(): - portScan(str(i), PORTS, WAIT_TIME, CLEARNET) - else: + try: + ips = IPv4Network(unicode(h)) + for i in ips.hosts(): + portScan(str(i), PORTS, WAIT_TIME, CLEARNET) + except: + parser.print_help() + exit() + + elif len(h.split("/")) < 2: portScan(h, PORTS, WAIT_TIME, CLEARNET) + else: + parser.print_help() + exit() endTime = time.time() totalTime = endTime - startTime |