From 3b289cf5583d4da52aa2b1a1b0ee4e44cb184c15 Mon Sep 17 00:00:00 2001 From: alexej996 Date: Sun, 28 Oct 2018 00:24:56 +0200 Subject: add support for scanning IP ranges --- tmap | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3