| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3794 人关注过本帖
标题:命令行 nc.py -h 后 它 print 出 err err err err 想usage()
只看楼主 加入收藏
c974288432
Rank: 3Rank: 3
等 级:论坛游侠
威 望:4
帖 子:44
专家分:104
注 册:2015-7-18
结帖率:50%
收藏
 问题点数:0 回复次数:0 
命令行 nc.py -h 后 它 print 出 err err err err 想usage()
#   ----nc.py---------
import sys
import time

def usage():
    print "BHP Net Tool"
    print
    print "Usage:kkkkkk"
    sys.exit(0)
   

def main():
    global listen
    global port
    global execute
    global command
    global upload_destination
    global target
   
    if not len(sys.argv[1:]):
        print  "err err err err"
        
    try:
        opts,args=getopt.getopt(sys.argv[1:],"hle:t:p:cu:", \
        ["help","listen","execute","target","port","command","upload"])
    except getopt.GetoptError as err:
            print str(err)
            usage()
            
            
    for o,a in opts:
        if o in("-h","--help"):             usage()
        elif o in("-l","--listen"):         print "llllllllll"
        elif o in("-e","--execute"):        print "eeeeeeeeee"
        elif o in("-c","--commandshell"):   print "cccccccccc"
        elif o in("-u","--upload"):         print "uuuuuuuuuu"
        elif o in("-t","--target"):         print "tttttttttt"
        elif o in("-p","--port"):           print "pppppppppp"
        else:
                                            assert False,"Unhandled Option"
              
           
#sys.argv[1:]="-h"            
main()
#raw_input("\n\nPress the enter key to exit.")  
time.sleep(300)
print "******************"
搜索更多相关主题的帖子: command listen target 
2016-06-08 20:56
快速回复:命令行 nc.py -h 后 它 print 出 err err err err 想usage()
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019934 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved