

【Root-Me】 Local File Inclusion
source link: https://exp-blog.com/safe/ctf/rootme/web-server/local-file-inclusion/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

【Root-Me】 Local File Inclusion
水题。关于 PHP 的 LFI 漏洞前置知识可以参考这篇文章: 【Local File Inclusion (LFI) — Web Application Penetration Testing】
但是不需要用到这些知识也能解题。
开启挑战后,随意点击发现一个规律:
| sysadm | reseau | esprit | crypto | coding | archives |
页头的 tag 其实就是 【目录】- 点击 tag 后出现的列表就是文件夹内的 【文件】或【子目录】
- 页面 URL 会随着点击变成
http://challenge01.root-me.org/web-serveur/ch16/?files=目录&f=文件
- 当点击【文件】时,会在页面输出文件内容

特别地,我发现如果点击【文件】后若没有输出文件内容,则这可能是【子目录】而非文件,
如: http://challenge01.root-me.org/web-serveur/ch16/?files=crypto&f=archives

此时可以把页面路径中代表【文件】的 f
(实际上是【子目录】)拼接到代表【目录】的 files
串成路径:
http://challenge01.root-me.org/web-serveur/ch16/?files=crypto/archives
这样就可以查看【子目录】下的文件了:

题目要求找到 admin 的内容,但是在所有 tag 及其下的文件都没看见 admin 。
考虑到可能需要路径穿越,于是尝试构造 payload :
http://challenge01.root-me.org/web-serveur/ch16/?files=..
得到上级目录下的文件列表,发现其中存在 admin
,但是点击后没有打印内容,怀疑 admin
其实是【子目录】:

于是构造新的 payload :http://challenge01.root-me.org/web-serveur/ch16/?files=../admin
发现 admin
目录下的的 index.php
文件,打开后得到密码,完成挑战:

flag 下载后的 flagzip 的文件需要手动更改后缀为
*.zip
,然后解压即可(为了避免直接刷答案)
Recommend
-
40
【Root-Me】 Local File Inclusion PHP 的 LFI 漏洞,前置知识参考这篇文章:【
-
6
PHP 的 RFI (远程文件包含)漏洞利用,与 LFI (本地文件包含)很类似。 题目要求我们获取 PHP 页面源码,开启挑战后,只有 Français (?lang=fr) 和
-
7
mPDF 7.0 - Local File Inclusion ...
-
4
Wifi HD Wireless Disk Drive 11 - Local File Inclusion ...
-
9
GLPI Glpiinventory v1.0.1 - Unauthenticated Local File Inclusion...
-
8
GLPI Activity v3.1.0 - Authenticated Local File Inclusion on Activity plugin...
-
5
GLPI 4.0.2 - Unauthenticated Local File Inclusion on Manageentities plugin...
-
8
Purchase Order Management-1.0 - Local File Inclusion ...
-
2
SoftExpert (SE) Suite v2.1.3 - Local File Inclusion ...
-
9
FileMage Gateway 1.10.9 - Local File Inclusion ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK