diff --git a/gateway/edge-functions/auth.js b/gateway/edge-functions/auth.js index 326f40f..0f2a441 100644 --- a/gateway/edge-functions/auth.js +++ b/gateway/edge-functions/auth.js @@ -13,218 +13,360 @@ const CONFIG = { export async function onRequest({ request }) { const url = new URL(request.url); - const hostname = url.searchParams.get('hostname') || url.hostname; - const html = getCaptchaPage(hostname); + const rawHostname = url.searchParams.get('hostname') || url.hostname; + const hostname = rawHostname.replace(/[<>"'&]/g, ""); // Basic XSS prevention + const clientIP = request.headers.get("EO-Client-IP") || "1.1.1.1"; + const zoneID = request.headers.get("EO-Zone-ID") || "UNKNOWN"; + + const html = getCaptchaPage(hostname, clientIP, zoneID); return new Response(html, { headers: { "Content-Type": "text/html; charset=utf-8" } }); } -function getCaptchaPage(hostname) { +function getCaptchaPage(hostname, clientIP, zoneID) { return ` - + + + + - - - ${CONFIG.title} - - - - - - +200: LOOP Captcha required + + + + + + + + + + + - -
-
-
${CONFIG.icon}
-

${CONFIG.title}

-

- Please complete the security check to access
- ${hostname} -

-
+ +
+
+ +
+

+ LOOP Captcha required + Error code 200 +

+
+ Visit www.s3xyseia.xyz for guest guidelines. +
+
Loading time...
+
-
- -
-
-
-
- - - + +
+ +
+
+ +
+
+ Challenge +
- I'm not a robot +
Loading puzzle...
-
- - - - reCAPTCHA + + +
+ +
+
+
+ + + +
+ I'm not a robot +
+
+ + reCAPTCHA +
+
+ + +
+
+ + +
+
+ +
Hint: ...
+
+
+
+
+
-
-
Loading...
- + +
+
+
+ +
+
+ + + + + +
+ +
+
+
+ You +

Browser

+ Mamba out +
+ +
+
+ +
+
+ + + + + +
+ +
+
+
+ Tencent Edgeone +

LOOP Cloud

+ Request Intercepted +
+
+ +
+
+ + + + + + +
+ +
+
+
+ ${hostname} +

Host

+ Working +
+
+
+
-
- Answer: - + +
+
+
+

What happened?

+

Robots/Low-sanity commonalty should stay out.

- -
- Hint:... +
+

What can I do?

+

Do the captcha to prove you are human (and welcome or not).

- -
- -
-
-

Protected by EdgeOne Functions

+ + +
+

+ Ray ID: ${zoneID} + + + Your IP: + + + + + Performance & security by LOOP Edge Functions +

+
+ + } + `; }