From 0bd0ef4a80d9d73c4d0d8fb271be154c2d262602 Mon Sep 17 00:00:00 2001 From: alexej996 Date: Sun, 28 Oct 2018 00:54:59 +0200 Subject: move printing of open ports from connScan to portScan --- tmap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tmap') diff --git a/tmap b/tmap index ca1d40b..0dab705 100755 --- a/tmap +++ b/tmap @@ -14,10 +14,9 @@ def connScan(host, port, wait, notor): sckt = socks.socksocket() sckt.settimeout(wait) - ## Try to connect, print to stdout on success + ## Try to connect, return True on success try: sckt.connect((host, port)) - print("[+] port {} on {} is open".format(port, host)) sckt.close() return True except KeyboardInterrupt: @@ -32,6 +31,7 @@ def portScan(host, ports, wait, notor): for p in ports: if connScan(host, p, wait, notor): openPorts += 1 + print("[+] port {} on {} is open".format(p, host)) print("{} open ports on {} .".format(openPorts, host)) def main(): -- cgit v1.2.3