Skip to content

Commit

Permalink
Adjust for base64
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsteele committed Jul 17, 2014
1 parent aefc578 commit f022eb5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/node/adv_directBrowse.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ws.on('message', function(data, flags) {
strictSSL: false,
};
if (['patch', 'post', 'put'].indexOf(obj.method.toLowerCase()) !== -1 && obj.body.length > 0) {
req.body = new Buffer(obj.body);
req.body = new Buffer(obj.body, 'base64');
}
request(req, function(err, resp, body) {
fs.appendFileSync(argv._[0] + '.rpt', '\n' + resp.statusCode + " Hash: " + hash(resp.body) + " " + req.method + " " + obj.url);
Expand Down
2 changes: 1 addition & 1 deletion examples/node/direct_browse.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ws.on('message', function(data, flags) {
strictSSL: false,
};
if (['patch', 'post', 'put'].indexOf(obj.method.toLowerCase()) !== -1 && obj.body.length > 0) {
req.body = new Buffer(obj.body);
req.body = new Buffer(obj.body, 'base64');
}
request(req, function(err, resp, body) {
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion examples/node/domxss.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ws.on('error', function(err) {
function domXSS(request, response) {
var contentType = response.headers['Content-Type'];
if (typeof contentType === 'string' && (contentType.indexOf('javascript') !== -1 || contentType.indexOf('html') !== -1)) {
var body = new Buffer(response.body).toString().split('\n');
var body = new Buffer(response.body, 'base64').toString('ascii').split('\n');
for (var i = 0; i < body.length; i++) {
var line = body[i].trim();
if (line.match(/(location\s*[\[.])|([.\[]\s*["']?\s*(arguments|dialogArguments|innerHTML|write(ln)?|open(Dialog)?|showModalDialog|cookie|URL|documentURI|baseURI|referrer|name|opener|parent|top|content|self|frames)\W)|(localStorage|sessionStorage|Database)/g)) {
Expand Down

0 comments on commit f022eb5

Please sign in to comment.