
看界面很像sql注入,但是试了几次发觉不太行。dirsearch扫一下目录,找到了www.zip文件。

profile.php里有反序列化的代码,应该可以利用:
<?php
require_once('class.php');
if($_SESSION['username'] == null) {
die('Login First');
}
$username = $_SESSION['username'];
$profile=$user->show_profile($username);
if($profile == null) {
header('Location: update.php');
}
else {
$profile = unserialize($profile);
$phone = $profile['phone'];
$email = $profile['email'];
$nickname = $profile['nickname'];
$photo = base64_encode(file_get_contents($profile['photo']));
?>
还看到了register.php,访问一下真的可以注册,注册好以后会让我们更新profile,再结合profile.php里对photo调用了file_get_contents函数,可以判断这里存在可注入点。

那我们要用file_get_contents读取哪个文件呢?发现config.php文件里有flag,但是在这里被隐藏了,所以我们的目标就是给photo传值‘config.php’

该博客揭示了一次Web应用的安全漏洞,通过SQL注入和PHP反序列化,作者详细描述了如何利用file_get_contents读取config.php文件,并利用字符串逃逸技巧获取flag。涉及的技术包括XSS、列名注入和安全控制绕过。
最低0.47元/天 解锁文章
470

被折叠的 条评论
为什么被折叠?



