summaryrefslogtreecommitdiff
path: root/tmap
diff options
context:
space:
mode:
authoralexej996 <aleksej@spidermail.tk>2018-10-28 00:24:56 +0200
committeralexej996 <aleksej@spidermail.tk>2018-10-28 00:24:56 +0200
commit3b289cf5583d4da52aa2b1a1b0ee4e44cb184c15 (patch)
tree44d4ae91f0fde61db5eb300b5c814dbb7ef2ace0 /tmap
parentc87cee411117cf669601c7529a369c4884b4d4bc (diff)
add support for scanning IP ranges
Diffstat (limited to 'tmap')
-rwxr-xr-xtmap8
1 files changed, 7 insertions, 1 deletions
diff --git a/tmap b/tmap
index bc7f360..d6924fb 100755
--- a/tmap
+++ b/tmap
@@ -3,6 +3,7 @@ from socket import *
import socks
import argparse
import time
+from ipaddress import *
## This function tries to open a connection on a specific port
def connScan(host, port, wait, notor):
@@ -95,7 +96,12 @@ def main():
## Scan each host in HOSTS list
for h in HOSTS:
- portScan(h, PORTS, WAIT_TIME, CLEARNET)
+ if len(h.split("/")) == 2:
+ ips = IPv4Network(unicode(h))
+ for i in ips.hosts():
+ portScan(str(i), PORTS, WAIT_TIME, CLEARNET)
+ else:
+ portScan(h, PORTS, WAIT_TIME, CLEARNET)
endTime = time.time()
totalTime = endTime - startTime