Skip to content

Commit 23a774e

Browse files
committed
fixed #1
1 parent ce12f1c commit 23a774e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xss-scanner",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Cross-Site Scripting (XSS) scanner. This tool helps to find possible XSS vulnerabilities.",
55
"keywords" : [ "xss", "xss-vulnerability", "xss-detection", "xss-exploitation", "xss-scanner" ],
66
"repository": {

src/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ function xssOptions() {
1616
path: "/special.plp?page={0}",
1717
method: "POST",
1818
protocol: "http:",
19-
postData: "paramName1=paramValue1&paramName2=paramValue2"
19+
postData: "paramName1={0}&paramName2=paramValue2"
2020
};
2121
}

src/payload.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var attack = function (line) {
4040

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

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

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

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

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

7272
if (config.method === "POST") {
73-
request.write(config.postData);
73+
request.write(stringFormat(config.postData, line));
7474
}
7575

7676
request.end();

0 commit comments

Comments
 (0)