MCPcopy Index your code
hub / github.com/geekcomputers/Python / main

Function main

nmap_scan.py:24–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23
24def main(): # Main Program
25 parser = optparse.OptionParser(
26 "usage%prog " + "-H <host> -p <port>"
27 ) # Display options/help if required
28 parser.add_option("-H", dest="tgtHost", type="string", help="specify host")
29 parser.add_option("-p", dest="tgtPort", type="string", help="port")
30 (options, args) = parser.parse_args()
31 tgtHost = options.tgtHost
32 tgtPorts = str(options.tgtPort).split(",")
33
34 if (tgtHost == None) | (tgtPorts[0] == None):
35 print(parser.usage)
36 exit(0)
37
38 for tgtPort in tgtPorts: # Scan the hosts with the ports etc
39 nmapScan(tgtHost, tgtPort)
40
41
42if __name__ == "__main__":

Callers 1

nmap_scan.pyFile · 0.70

Calls 2

exitFunction · 0.85
nmapScanFunction · 0.85

Tested by

no test coverage detected