惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
美团技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
T
Tailwind CSS Blog
D
Docker
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
腾讯CDC
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
U
Unit 42
The Cloudflare Blog
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
爱范儿
爱范儿
Recent Announcements
Recent Announcements
博客园 - 聂微东
博客园 - 叶小钗
H
Help Net Security
MyScale Blog
MyScale Blog

ABB00717

SecList Knock Pivoting and Tunneling Broken Authentication Login Brute Forcing Reverse Shell Web Fuzzing HTB - SpeedNet PHP Filter to RCE Redis HTB - Pollution HTB - Pollution 工具 常見服務 HTB - BroScience HTB - BroScience 如何把爛爛的 shell 升級成好用的 TTY 滲透筆記 HTB - Imagery HTB - Imagery HTB - Reset HTB - Reset HTB - Trick HTB - Trick HTB - Editorial HTB - Editorial 150. Evaluate Reverse Polish Notation droopescan 安裝找不到 module imp 解決「桌面背景被當成一個視窗不斷重新彈出並覆蓋其他視窗」的問題 桌面不斷彈出覆蓋其他視窗
File Inclusion
2026-09-19 · via ABB00717

通常我都會配合 ffuf 和指定辭典使用:

  • SecLists/Fuzzing/LFI/LFI-Jhaddix.txt:我會最優先使用的
  • PayloadsAllTheThings/Directory\ Traversal/Intruder/dotdotpwn.txt:測的東西比 Jhaddix 多很多,但很容易誤報。

Nineveh

Nineveh 靶機中,我們發現 http://nineveh.htb/department/manage.php?notes=files/ninevehNotes.txt 存在 File Inclusion 漏洞,只要以 http://nineveh.htb/department/manage.php?notes=files/ninevehNotes/../../../../../../ 為底即可存取本機上 www-data 有權讀取的任何檔案,例如 /etc/hostname

它的 PHP 是這麼寫的:

<?php
        $file = @$_GET['notes'];
        if (strlen($file) > 55)
            exit('File name too long.');
        $fileName = basename($file);
        if (!strpos($file, 'ninevehNotes'))
            exit('No Note is selected.');
        echo '<pre>';
        include ($file);
        echo '</pre>';
?>

緩解措施

  • 改以白名單映射。使用者輸入僅作為識別碼,由伺服器端對應到實際路徑,不讓輸入內容參與路徑組合。
  • 若必須接受路徑,先以 realpath() 正規化,再驗證結果仍位於基準目錄之內,才進行讀取。
  • 於 PHP 設定中關閉 allow_url_includeallow_url_fopen,避免本機檔案包含被提升為遠端檔案包含。
  • 以最小權限執行網頁服務,縮小即使遭利用也能讀取的檔案範圍。