Advertisement
rfmonk

portscan.py

Nov 22nd, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #! /usr/bin/env python
  2.  
  3. import optparse
  4. parser = optparse.OptionParser('usage %prog -H' +\
  5.     '<target host> -p <target port>')
  6.  
  7. parser.add_option('-H', dest='tgtHost', type='string', \
  8.     help='specify target host')
  9.  
  10. parser.add_option('-p', dest='tgtPort', type='int', \
  11.     help='specify target port')
  12. (options, args) = parser.parse_args()
  13. tgtHost = options.tgtHost
  14. tgtPort = options.tgtPort
  15. if (tgtHost == None) | (tgtPort == None):
  16.     print parser.usage
  17.     exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement