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

Function main

portscanner.py:52–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51
52def main():
53 parser = optparse.OptionParser("usage %prog -H" + " <target host> -p <target port>")
54 parser.add_option("-H", dest="tgtHost", type="string", help="specify target host")
55 parser.add_option(
56 "-p",
57 dest="tgtPort",
58 type="string",
59 help="specify target port[s] seperated by a comma",
60 )
61 (options, args) = parser.parse_args()
62 tgtHost = options.tgtHost
63 tgtPorts = str(options.tgtPort).split(",")
64 if (tgtHost == None) | (tgtPorts[0] == None):
65 print(parser.usage)
66 exit(0)
67 portScan(tgtHost, tgtPorts)
68
69
70if __name__ == "__main__":

Callers 1

portscanner.pyFile · 0.70

Calls 2

exitFunction · 0.85
portScanFunction · 0.85

Tested by

no test coverage detected