summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexej996 <aleksej@spidermail.tk>2018-11-03 22:32:40 +0100
committeralexej996 <aleksej@spidermail.tk>2018-11-03 22:32:40 +0100
commitd3c624c601ed0ad863045ed3057eb2bf2e8dd1d9 (patch)
treeb31b97921ec554639db08c83956801895dce793b
parent6aee72b405362d42511f749100f28d7c863e4096 (diff)
host value checking
-rwxr-xr-xtmap16
1 files 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