()
| 50 | |
| 51 | |
| 52 | def 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 | |
| 70 | if __name__ == "__main__": |
no test coverage detected