Skip to content

Commit

Permalink
fixed #1
Browse files Browse the repository at this point in the history
  • Loading branch information
dragthor committed Mar 2, 2017
1 parent ce12f1c commit 23a774e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xss-scanner",
"version": "0.0.7",
"version": "0.0.8",
"description": "Cross-Site Scripting (XSS) scanner. This tool helps to find possible XSS vulnerabilities.",
"keywords" : [ "xss", "xss-vulnerability", "xss-detection", "xss-exploitation", "xss-scanner" ],
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ function xssOptions() {
path: "/special.plp?page={0}",
method: "POST",
protocol: "http:",
postData: "paramName1=paramValue1&paramName2=paramValue2"
postData: "paramName1={0}&paramName2=paramValue2"
};
}
6 changes: 3 additions & 3 deletions src/payload.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var attack = function (line) {

if (config.method === "POST") {
reqOptions.headers["Content-Type"] = "application/x-www-form-urlencoded";
reqOptions.headers["Content-Length"] = Buffer.byteLength(config.postData)
reqOptions.headers["Content-Length"] = Buffer.byteLength(stringFormat(config.postData, line));
}

var request = http.request(reqOptions, (res) => {
Expand All @@ -55,7 +55,7 @@ var attack = function (line) {
if (statusCode != 200) return;
if (rawData == null || rawData.length === 0) return;

rawData = "<![CDATA[ " + line + "]]>" + rawData;
rawData = "<!-- <![CDATA[ " + line + "]]> -->" + rawData;

console.log(chalk.red(line));

Expand All @@ -70,7 +70,7 @@ var attack = function (line) {
});

if (config.method === "POST") {
request.write(config.postData);
request.write(stringFormat(config.postData, line));
}

request.end();
Expand Down

0 comments on commit 23a774e

Please sign in to comment.