summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexej996 <aleksej@spidermail.tk>2018-10-28 00:54:59 +0200
committeralexej996 <aleksej@spidermail.tk>2018-10-28 00:54:59 +0200
commit0bd0ef4a80d9d73c4d0d8fb271be154c2d262602 (patch)
treec5a4a20a8c99c2a1d43b714fc55b0f2cdd83607a
parent3f78328c9b5fdc7b4151bb887ac73e1173ad7dbb (diff)
move printing of open ports from connScan to portScan
-rwxr-xr-xtmap4
1 files changed, 2 insertions, 2 deletions
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():