Fix MITM window

This commit is contained in:
decolua
2026-03-16 09:27:26 +07:00
parent 65af4328fd
commit 62d7e61907
8 changed files with 105 additions and 136 deletions
@@ -23,6 +23,16 @@ function getPassword(provided) {
return provided || getCachedPassword() || null;
}
function checkIsAdmin() {
if (!isWin) return true;
try {
require("child_process").execSync("net session >nul 2>&1", { windowsHide: true });
return true;
} catch {
return false;
}
}
// GET - Full MITM status (server + per-tool DNS)
export async function GET() {
try {
@@ -34,6 +44,7 @@ export async function GET() {
certTrusted: status.certTrusted || false,
dnsStatus: status.dnsStatus || {},
hasCachedPassword: !!getCachedPassword(),
isAdmin: checkIsAdmin(),
});
} catch (error) {
console.log("Error getting MITM status:", error.message);