WeChall - Warchall - Live RFI
Here's something encrypted, password is required to continue reading.
Sam decided to make a music site. Unfortunately he does not understand Apache.
Sam 决定做一个音乐网站,可惜他不懂 Apache 配置。
页面上随机显示一句歌词,如
"Ghetto Gospel" is the best!,每次刷新会变。没有密码输入框,没有明显的交互元素。
这题考察的是 Apache 服务器配置知识,解题过程像一个探索任务。
多次刷新页面,歌曲会变化,包括:
搜索这些歌曲,全部是 Elton John 的作品。这暗示了目录结构。
尝试拼出 Elton 的名字:访问
/missions/basic/11/e/,返回目录列表。继续逐层访问:
1 | /missions/basic/11/e/ |
/e/l/t/o/n/ 目录看起来是空的,但在 Apache
中,.htaccess 文件可能被目录列表隐藏了。直接访问:
1 | https://www.hackthissite.org/missions/basic/11/e/l/t/o/n/.htaccess |
内容:
1 | IndexIgnore DaAnswer.* .htaccess |
IndexIgnore:告诉 Apache 目录列表中不要显示
DaAnswer.* 和 .htaccess<Files .htaccess>:允许所有人访问
.htaccess(这是关键错误,应该禁止访问)既然 .htaccess 泄露了隐藏的文件名,直接访问:
1 | https://www.hackthissite.org/missions/basic/11/e/l/t/o/n/DaAnswer |
页面显示动态文本,如:
1 | The answer is available! |
访问
/missions/basic/11/index.php(注意不是入口页面),会出现密码输入框。表单字段名是
answer,提交 available 即可过关。
1 | $ curl -sL -b 'HackThisSite=YOUR_COOKIE' \ |
核心知识点:
IndexIgnore
只是不在目录列表中显示文件,文件本身仍然可以被直接访问.htaccess
文件应该禁止外部访问(Require all denied),否则会泄露目录配置信息