summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstevan <stevannestorovic@hotmail.com>2018-09-30 13:44:09 +0200
committerstevan <stevannestorovic@hotmail.com>2018-09-30 13:44:09 +0200
commit34945fe2281bfd9b8e9ba8fb6f3cc045374ee379 (patch)
treeb090f93fac2c5760d114a3fd6c1940efb53d324a
parent9b86e0a78bcf13f76891c5dc541bb535fe183218 (diff)
Added time info at the end, fixed some print statements to use py3 syntax
-rw-r--r--.gitignore1
-rw-r--r--README.md3
-rwxr-xr-xtmap15
3 files changed, 15 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c18dd8d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+__pycache__/
diff --git a/README.md b/README.md
index a82c713..647f5a0 100644
--- a/README.md
+++ b/README.md
@@ -29,3 +29,6 @@ Scan port 80 on facebookcorewwwi.onion
`./tmap -H 192.168.0.1 -p 0-1024 --clearnet`
Scan ports from 0 to 1024 on 192.168.0.1 without routing traffic through Tor.
+
+### License
+**GPL3**
diff --git a/tmap b/tmap
index 81771ff..8603623 100755
--- a/tmap
+++ b/tmap
@@ -2,6 +2,7 @@
from socket import *
import socks
import argparse
+import time
## This function tries to open a connection on a specific port
def connScan(host, port, wait, notor):
@@ -26,6 +27,8 @@ def portScan(host, ports, wait, notor):
connScan(host, p, wait, notor)
def main():
+ startTime = time.time()
+
## Define and parse the arguments
parser = argparse.ArgumentParser(description="Simple port scanner that works over Tor")
parser.add_argument("HOSTS", help="IP or domain to scan", default="empty_host", nargs="?")
@@ -41,7 +44,7 @@ def main():
if args.HOSTS == "empty_host":
if args.tgtHost == "empty_host_option":
parser.print_help()
- print "\nHost must be specified"
+ print ("Host must be specified")
exit()
else:
args.HOSTS = args.tgtHost
@@ -53,13 +56,14 @@ def main():
## Load specified ports into PORTS list
if "-" not in args.tgtPort:
- PORTS = map(int, args.tgtPort.split(","))
+ PORTS = map(int, args.tgtPort.split(","))
else:
PORTS = map(int, args.tgtPort.split("-"))
if len(PORTS) != 2:
parser.print_help()
exit()
- PORTS = range(PORTS[0],PORTS[1])
+ else:
+ PORTS = range(PORTS[0],PORTS[1]+1)
## Load other variables
HOSTS = args.HOSTS.split(",")
@@ -72,6 +76,9 @@ def main():
## Scan each host in HOSTS list
for h in HOSTS:
portScan(h, PORTS, WAIT_TIME, CLEARNET)
+ endTime = time.time()
+ totalTime = endTime - startTime
+ print("Scan done in {} seconds".format(round(totalTime, 2)))
if __name__ == "__main__":
- main()
+ main()