7

【Root-Me】 Directory traversal

 2 years ago
source link: https://exp-blog.com/safe/ctf/rootme/web-server/directory-traversal/
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.
neoserver,ios ssh client

【Root-Me】 Directory traversal



这题要求找出画廊中隐藏的部分,而题目提示是目录遍历(Directory traversal)。

观察发现点击不同的分类, URL 中 ?galerie=${dir} 会对应变化。

多次测试,当 ${dir} 为空、即 ?galerie= 时,会出现有一个展示所有子目录的漏洞。

01.png

不难发现多了一个目录 86hwnX2r (注意渲染显示的目录名称不全,需要打开源码查看)。

02.png

修改 URL 请求参数为 ?galerie=86hwnX2r ,发现下面有一个文件 password.txt,查看源码知道该文件位置为 galerie/86hwnX2r/password.txt,拼接路径到根 URL (注意不要拼接到 URL 参数)即可查看到密码,完成挑战。

03.png

flag 下载后的 flagzip 的文件需要手动更改后缀为 *.zip,然后解压即可(为了避免直接刷答案)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK