2014-09-25 212 views
0

我正在尋找IE插件或任何類似的解決方案,它可以在HTTP請求標頭和文檔DOM中欺騙Referer。 我正在使用Fiddler在HTTP請求頭中設置Referer,但document.referrer變量仍爲空,我想將其設置爲固定字符串。 我需要這個用於自動攻擊工具包爬行,因爲一些受感染的站點同時檢查請求標頭和document.referer。請求標頭和DOM中的欺騙請求標頭

感謝

回答

0

沒關係,解決了吧:)

在提琴手:

static function OnBeforeResponse(oSession: Session) { 

if (oSession.oResponse.headers.ExistsAndContains("Content-Type","text/html")) { 
    oSession.utilDecodeResponse(); 

    var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes); 
    var oRegEx = /(<\/head>)/i; 
    oBody = oBody.replace(oRegEx, "<script type='text/javascript'>if ((window.document.referrer == '') || (typeof window.document.referrer === 'undefined')) {window.document.__defineGetter__('referrer', function() {return 'http://google.com/';})};</script>$1"); 

    oSession.utilSetResponseBody(oBody); 
} 

}