summaryrefslogtreecommitdiff
path: root/tmap
diff options
context:
space:
mode:
authorStevan <nestorovicstevan@tutanota.de>2019-06-09 14:52:11 -0400
committerStevan <nestorovicstevan@tutanota.de>2019-06-09 14:52:11 -0400
commit6bd1ec22519551cf6f901db066e95de9f1a597d9 (patch)
treeea91ac9414c03fcfe936df6ce1b5942447738146 /tmap
parent9a615bd32f13fcb7a89605f77ce851b39c2abb2f (diff)
REFACTORING: Added parseArgs function. Fixed a typo in readme.
Diffstat (limited to 'tmap')
-rwxr-xr-xtmap14
1 files changed, 7 insertions, 7 deletions
diff --git a/tmap b/tmap
index 98a4c07..0d9da66 100755
--- a/tmap
+++ b/tmap
@@ -148,12 +148,7 @@ def hostScan(host, ports, wait, notor, jobs):
return ret
-def main():
- ## Record time of program starting in seconds
- startTime = time.time()
-
- ## Define and parse the arguments
- parser = argparse.ArgumentParser(description="Simple stateful port scanner that works over Tor")
+def parseArgs(parser):
parser.add_argument("--version", dest="version", help="print version information and exit", action="store_true")
parser.add_argument("HOSTS", help="IP address or domain to scan", default="empty_host", nargs="?")
parser.add_argument("-H", "--hosts", metavar="HOSTS", dest="tgtHost", help="IP address or domain to scan", default="empty_host_option")
@@ -164,8 +159,13 @@ def main():
parser.add_argument("--torport", metavar="TORPORT", dest="torPort", type=int, help="port on which Tor is listening on", default="9050")
parser.add_argument("-j", "--jobs", metavar="JOBS", dest="jobs", type=int, help="maximum number of open connections at the same time", default="10")
parser.add_argument("--output", metavar="OUTFILE", dest="outFile", help="write scan results to output file", default="empty_outfile")
+ return parser.parse_args()
- args = parser.parse_args()
+
+def main():
+ ## Record time of program starting in seconds
+ startTime = time.time()
+ args = parseArgs(argparse.ArgumentParser(description="Simple stateful port scanner that works over Tor"))
## Version argument
if args.version: