Rock's blog

兴趣是最好的老师

0%

[网鼎杯 2020 半决赛]AliceWebsite

[网鼎杯 2020 半决赛]AliceWebsite

首先题目给出了源代码,包含index.php,about.phphome.php

其中index.php存在文件包含漏洞。

1
2
3
4
5
6
7
8
<?php
$action = (isset($_GET['action']) ? $_GET['action'] : 'home.php');
if (file_exists($action)) {
include $action;
} else {
echo "File not found!";
}
?>

代码虽然限制了文件必须存在,但尝试访问/etc/passwd是可以访问到的。故直接访问/flag

image-20220315200601374