Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

Commit

Permalink
Cookies are split and added to the webpage object one by one
Browse files Browse the repository at this point in the history
  • Loading branch information
forced-request committed Sep 14, 2014
1 parent 84be1ea commit 8f7f266
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion xss-detector/xss.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ server = webserver.create();
var host = '127.0.0.1';
var port = '8093';

/**
* Split cookies by semicolon and add each cookie to the webpage
* object separately.
*/
parseCookies = function(cookies, wp) {
cookieArray = cookies.split(";");
for (var i = 0; i < cookieArray.length; i++) {
cookieArgs = cookieArray[i].split("=");
wp.addCookie({
'name': cookieArgs[0],
'value': cookieArgs[1]
});
}
return wp;
}

/**
* parse incoming HTTP responses that are provided via BURP intruder.
* data is base64 encoded to prevent issues passing via HTTP.
Expand All @@ -46,7 +62,9 @@ parsePage = function(data,url,cookies) {

var html_response = "";
wp.setContent(data, decodeURIComponent(url));
wp.cookies = cookies;

// Parse cookies from intruder and add to request
wp = parseCookies(cookies,wp);

// Evaluate page, rendering javascript
xssInfo = wp.evaluate(function (wp) {
Expand Down

0 comments on commit 8f7f266

Please sign in to comment.