()
| 22 | |
| 23 | |
| 24 | def 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 | |
| 42 | if __name__ == "__main__": |
no test coverage detected