python-optparse模块给脚本增加参数选项

import optparse parser = optparse.OptionParser('[-] Usage %prog '+\ '-H -l [-p -F ]') parser.add_option('-H', dest='tgtHost', type='string',\ help='specify the target address[es]') parser.add_option('-p', dest='lport', type='string',\ help='specify the listen port') parser.add_option('-l', dest='lhost', type='string',\ help='specify the listen address') parser.add_option('-F', dest='passwdFile', type='string',\ help='password file for SMB brute force attempt')

(options, args) = parser.parse_args()

posted @ 2017-02-23 11:35  itholiday  阅读(287)  评论(0编辑  收藏  举报