From d3c624c601ed0ad863045ed3057eb2bf2e8dd1d9 Mon Sep 17 00:00:00 2001 From: alexej996 Date: Sat, 3 Nov 2018 22:32:40 +0100 Subject: host value checking --- tmap | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tmap b/tmap index 541e4e3..2ef3f71 100755 --- a/tmap +++ b/tmap @@ -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 -- cgit v1.2.3