-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated sink location in path traversal
- Loading branch information
1 parent
83eb33d
commit 6618e45
Showing
127 changed files
with
1,667 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "dome.js:5:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "demo.js:6:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:36:10" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:5:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "server.js:36:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "caolili.js:10:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "caolili.js:7:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:7:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:9:12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:5:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:10:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "server.js:30:12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "node.js:9:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:14:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,98 @@ | ||
let oldreadFileSync = require("fs").readFile; | ||
let oldreadFileSync = require("fs").readFileSync; | ||
let oldreadFile = require("fs").readFile; | ||
const fs = require("fs"); | ||
const output_file = "sink_locations_path_traversal.txt"; | ||
|
||
require("fs").readFile = function () { | ||
require("fs").readFileSync = function () { | ||
var args = arguments; | ||
let stack = new Error().stack.toString().split("\n"); | ||
// console.log(args[0]); | ||
try { | ||
// fs.writeFileSync('./aaaaaaaaaaaaaaaaaaaaaaa.txt', args.join('\n')); | ||
fs.appendFileSync(output_file, stack.join("\n")); | ||
let index = 0; | ||
for (let i = 0; i < stack.length; i++) { | ||
if (stack[i].includes("node_modules") && !stack[i].includes(".test.js")) { | ||
index = i; | ||
break; | ||
let flag = args[0]; | ||
if (flag.includes("flag")) { | ||
fs.appendFileSync(output_file, stack.join("\n")); | ||
let index = 0; | ||
for (let i = 0; i < stack.length; i++) { | ||
if ( | ||
stack[i].includes("node_modules") && | ||
!stack[i].includes(".test.js") | ||
) { | ||
index = i; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
let line = stack[index]; | ||
var preString = "node_modules/"; | ||
var searchString = "/"; | ||
var preIndex = line.indexOf(preString); | ||
var cut_line = line.substring(preIndex); | ||
console.log(cut_line); | ||
var first_index = cut_line.indexOf("/"); | ||
var last_index = cut_line.lastIndexOf("/"); | ||
package_name = cut_line.substring(first_index + 1, last_index); | ||
console.log(package_name); | ||
sink = cut_line.substring(last_index + 1); | ||
sink = sink.replace(")", "").trim(); | ||
// console.log(sink) | ||
fs.appendFileSync(output_file, "\nsink ==> " + sink + "\n"); | ||
let line = stack[index]; | ||
var preString = "node_modules/"; | ||
var searchString = "/"; | ||
var preIndex = line.indexOf(preString); | ||
var cut_line = line.substring(preIndex); | ||
console.log(cut_line); | ||
var first_index = cut_line.indexOf("/"); | ||
var last_index = cut_line.lastIndexOf("/"); | ||
package_name = cut_line.substring(first_index + 1, last_index); | ||
console.log(package_name); | ||
sink = cut_line.substring(last_index + 1); | ||
sink = sink.replace(")", "").trim(); | ||
// console.log(sink) | ||
fs.appendFileSync( | ||
output_file, | ||
"\npackage name ==> " + package_name + "\n" | ||
); | ||
fs.appendFileSync(output_file, "\nsink ==> " + sink + "\n"); | ||
} | ||
} catch (err) { | ||
// console.error(err) | ||
fs.writeFileSync(output_file, err); | ||
} | ||
return oldreadFileSync.apply(this, args); | ||
}; | ||
|
||
// try { | ||
// fs.writeFileSync('./aaaaaaaaaaaaaaaaaaaaaaa.txt', "sdfsdfsdfsd") | ||
// //file written successfully | ||
// } catch (err) { | ||
// // console.error(err) | ||
// } | ||
require("fs").readFile = function () { | ||
var args = arguments; | ||
let stack = new Error().stack.toString().split("\n"); | ||
// console.log(args[0]); | ||
try { | ||
// fs.writeFileSync('./aaaaaaaaaaaaaaaaaaaaaaa.txt', args.join('\n')); | ||
let flag = args[0]; | ||
if (flag.includes("flag")) { | ||
fs.appendFileSync(output_file, stack.join("\n")); | ||
let index = 0; | ||
for (let i = 0; i < stack.length; i++) { | ||
if ( | ||
stack[i].includes("node_modules") && | ||
!stack[i].includes(".test.js") | ||
) { | ||
index = i; | ||
break; | ||
} | ||
} | ||
|
||
let line = stack[index]; | ||
var preString = "node_modules/"; | ||
var searchString = "/"; | ||
var preIndex = line.indexOf(preString); | ||
var cut_line = line.substring(preIndex); | ||
console.log(cut_line); | ||
var first_index = cut_line.indexOf("/"); | ||
var last_index = cut_line.lastIndexOf("/"); | ||
package_name = cut_line.substring(first_index + 1, last_index); | ||
console.log(package_name); | ||
sink = cut_line.substring(last_index + 1); | ||
sink = sink.replace(")", "").trim(); | ||
// console.log(sink) | ||
fs.appendFileSync( | ||
output_file, | ||
"\npackage name ==> " + package_name + "\n" | ||
); | ||
fs.appendFileSync(output_file, "\nsink ==> " + sink + "\n"); | ||
} | ||
} catch (err) { | ||
// console.error(err) | ||
fs.writeFileSync(output_file, err); | ||
} | ||
return oldreadFileSync.apply(this, args); | ||
}; | ||
|
||
require(process.argv[2]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "app.js:8:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:35:16" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:35:16" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "server.js:53:12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:5:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:8:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "server.js:37:12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "goserv.js:63:9" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:7:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:7:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "1.0.7", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "http-live:55:7" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "Infra.data.js:137:9" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:5:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:5:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "node.js:7:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:5:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:23:12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:9:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:7:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:7:8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
}, | ||
"fixedVersion": "n/a", | ||
"fixCommit": "n/a", | ||
"sink": "" | ||
"sink": "index.js:8:8" | ||
} |
Oops, something went wrong.