1

【Root-Me】 Backup file

 2 years ago
source link: https://exp-blog.com/safe/ctf/rootme/web-server/backup-file/
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】 Backup file

这题全靠猜。题目声明了 No clue ,从各个方向找确实也没有什么信息。

最开始想到用 Burp Suite -> Intruder 或者 hydra 做登录账密爆破,但是无果,应该不是弱密码。

01.png

其实题目本身就是提示:Backup file(备份文件)。

换个角度想,可能这个 web 服务的某个文件的备份,曾经写入过账密信息,需要找出这个备份文件。

于是又测试了命令注入,尝试打印目录列表,无果。

再换个角度想,可能是某种工具编辑文件后自动生成的文件备份,需要去猜这个备份文件的名称。但首先需要猜这个被编辑的文件是什么,才能猜它的备份文件名

首先想到被编辑的是首页,直接在 URL 末尾补 index.*** 测试首页文件名,除了 index.php 之外都是跳到 404,这样就确定了首页文件名了。

然后再猜常见的备份后缀 index.php.bakindex.php_bakindex.php-bak 等等也都是跳到 404 。

后来想了想, web 服务一般都是在 linux 系统的, linux 常用的文本编辑器是 vim, 而 vim 开启自动备份后,备份文件的后缀是波浪号 ~

于是尝试在 URL 末尾补 index.php~ , Bingo !!! 下载了该备份文件,打开之后找到了密码,完成挑战。

02.png
03.png

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK