作者:
小樂天
·
2014/07/07 12:05
0x00 Intruder Scan
傳送一個你想csrf_token的請求到intruder。
1)Positions設定如下:

2)Options設定如下:
Request Engine

options>Grep-Extract>add


3)payloads設定如下

這裡payload type設定遞迴(Recursive grep),在Initial payload for first request設定一個有效的csrf_token值作為第一項

0x01 Active Scan with sqlmap
其實這個結合sqlmap有兩種方法,[email protected],我採用的也是他那個程式碼,但是在注入的時候我發現在burpsuite裡檢視HTTP history(歷史記錄)裡的token是沒有變化的,但是還是可以注入,剛開始挺納悶的,我以為他寫的那個程式碼有問題,後來他說不是,在burpsuite裡是看不到的,然後我也同意他說的,就是替換這個過程直接經過宏功能替換了,不會顯示在歷史記錄裡。我這裡就說下第二種方法吧。第一種點這裡。
1)首先是登入csrf_token頁面,不需要攔截。然後選擇Options>Sessions>Add


2)接著會彈出一個視窗選擇Select macro>add

3)點選add後會彈出兩個頁面如圖所示:

4)選擇2-3個頁面,第一個頁面是請求頁面,第二個頁面是post資料的時候的頁面,為了便於檢視我這裡新增了3個頁面。

5)選擇第二個頁面點選Configure item,指定root,新增一個自定義token引數


6)最後配置完可以點選Test macro看看我們配置成功了沒


7)如果以上配置成功,再選擇Scope選擇應用範圍


8)接著就是放到sqlmap裡去跑資料咯
如果是post頁面,這裡是把post的資料儲存到request.txt檔案裡,然後執行命令如下:
./sqlmap.py -r request.txt –proxy=http://127.0.0.1:8080
如果是get頁面命令如下:
./sqlmap.py –u “www.target.com/vuln.php?id=1” –proxy=http://127.0.0.1:8080

0x02 Session Randomness Analysis Sequencer
請求攔截一個地址,在響應內容中如果有cookie,或者我們可以在sequencer中自定義配置token引數


然後點選Start live capture進行分析

等分析完即可生成報告,透過報告我們可以看出token是否可以偽造。
參考資料:http://resources.infosecinstitute.com/session-randomness-analysis-burp-suite-sequencer/
本文章來源於烏雲知識庫,此映象為了方便大家學習研究,文章版權歸烏雲知識庫!