网络安全渗透第6节课笔记
SQL注入分类:
1.回显正常
2.回显报错
3.盲注
mysql报错注入常用函数:
1.floor
2.updatexml
select user,password from users where user_id=1 and updatexml(1,concat(0x7e,user(),0x7e,database()),3);
3.extractvalue
select user,password from users where user_id=1 and extractvalue(0x7e,concat(0x7e,user(),0x7e,database()));
盲注:
1.布尔盲注
只返回True或者False
1.时间盲注
无论注入成功与否,页面都无变化。
响应时间有差异。
常见字符集:
ascii
GB2312
BIG5
GB18030
Unicode
常见字符集编码:
英文编码(单字节)
中文编码(宽字节)
Unicode编码
UTF-8编码
查询数据库编码:
show variables like"character_set_%";
client
connection
results
set names utf-8
统一编码可解决网页乱码

addslashes()
对注入的一些特殊字符进行转义。
宽字节注入:
使用addslashes()函数会对单引号进行转义,转义为\'
url中\'为%5c%27
1.吃掉\
%df%5c为一个汉字 堚
输入:%df%5c%27
转义:%df%5c%27
执行:%df%5c%27
输出:堚'
2.构造\\
%e5%5c为一个汉字 錦
输入:%e5\'
转义:%e5 %5c%5c %5c%27
执行:%e5%5c %5c%5c %27
输出:錦\\'
区别在于输入的格式。
乌云虚拟机
账号:hancool
密码:qwe123

浙公网安备 33010602011771号