diff options
author | alexej996 <aleksej@spidermail.tk> | 2018-10-28 00:24:56 +0200 |
---|---|---|
committer | alexej996 <aleksej@spidermail.tk> | 2018-10-28 00:24:56 +0200 |
commit | 3b289cf5583d4da52aa2b1a1b0ee4e44cb184c15 (patch) | |
tree | 44d4ae91f0fde61db5eb300b5c814dbb7ef2ace0 /tmap | |
parent | c87cee411117cf669601c7529a369c4884b4d4bc (diff) |
add support for scanning IP ranges
Diffstat (limited to 'tmap')
-rwxr-xr-x | tmap | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |