Residential proxy services sold exits on the White House network this fall. Layer3 Intel's probes left through AS2650, the Executive Office of the President's network, 236 times between October 5 and November 3, 2026, from six addresses, through 28 different proxy services. Anyone with a few dollars could do the same.
The State Department asked Layer3 for its logs the morning after the post went up, The Register reported. It wasn't a one-off: a November study by ipgeolocation.io, whose API the examples below call, found 975 exit addresses tied to 295 government, military, and international organizations in 82 countries. Is my network a residential proxy exit too?
To check, list the public IPs your traffic leaves from, look each one up in residential proxy data, and confirm you held the address on the date it was seen. If one is flagged, your DNS, flow, and endpoint logs are where you find the device behind it.
TL;DR
Step 1: list the prefixes your ASN announces and drop the overlaps. AS2650 announces a /16 and three /24s inside it.
Step 2: check your egress IPs, not the whole announcement. A /16 is 65,536 lookups; your NAT and Wi-Fi exits are a handful.
proxy_days_seen_7dcounts days the IP was seen this week;proxy_provider_count_30dcounts providers offering it. Neither identifies a device.Step 3: the data has dates, not times, so you find the device through DNS, flow, and endpoint logs.
A failed lookup isn't a clean result: the program exits 0, 1, or 2 so monitoring can tell them apart.
The check is about 260 lines of C# on .NET 8, with no NuGet packages. A flag says an address was for rent on a given day. Finding the device behind it happens in your own logs, and that's most of the work.
What a residential proxy exit looks like from outside
A residential proxy exit, or exit node, is the address a proxy customer's traffic leaves from. To the website on the other end, the request comes from your network. A device becomes one when software on it accepts proxy jobs: an SDK bundled into a free app, a free VPN with the enrollment buried in its terms, a streaming box that shipped with it, or an app that pays you for "unused bandwidth". The FBI's March 2026 warning on residential proxy networks lists those four and a fifth: malware hidden in pirated games, films, and software.
Two things go wrong for the network owner. Strangers' traffic (scraping, credential stuffing, phishing) leaves from your addresses, so the abuse reports and blocks land on you. And a device inside your network is taking jobs from outside it. Layer3 pointed out that poorly secured residential proxy SDKs can let buyers reach other machines on the same local network.
DNS traces of this software are common. Infoblox found that over 65% of its Threat Defense Cloud customers queried residential proxy domains in 2026, including over 60% of its government and banking customers. That counts lookups, not confirmed exits.
Set up the project
You need the .NET 8 SDK. Create a console app, then replace the generated Program.cs with the five C# blocks below, pasted in order:
dotnet new console -n ExitCheck
Each block declares public static partial class ExitCheck, so every block is a complete piece of C# and the five together are the whole Program.cs. The template's implicit usings and the explicit ones in the first block live together without warnings. Settings come from environment variables: IPGEO_API_KEY, EGRESS_IPS, and an optional ASN.
Step 1: List the prefixes you announce
If your organization has its own ASN, start with what it announces. The ASN endpoint returns the routes with include=routes. For AS2650 it returns five routes, and four of them overlap: 165.119.0.0/16 plus three /24s inside it. Check those naively and you'd look up the same addresses twice, so drop the overlaps first.
The code below calls the same provider's ASN and IP Security endpoints, with one key for both. If you only need the route list, RIPEstat's announced-prefixes data call returns the same five prefixes without a key. It covers the last two weeks by default; for an older sighting, query the dates around it, since a route's origin can change.
The first block is the HTTP layer:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
using System.Net.Sockets;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Threading.Tasks;
public sealed class ApiException(string message) : Exception(message);
public static partial class ExitCheck
{
const string Api = "https://api.ipgeolocation.io/v3";
static readonly Dictionary<int, string> Errors = new()
{
[401] = "key rejected, or the key can't use this endpoint",
[403] = "this machine's IP isn't on the key's allow-list",
[429] = "usage limit reached",
};
static void Log(string level, string message) => Console.Error.WriteLine($"{level} {message}");
static async Task<JsonNode?> CallAsync(HttpClient http, HttpMethod method, string path,
Dictionary<string, string> query, object? body = null)
{
query["apiKey"] = Environment.GetEnvironmentVariable("IPGEO_API_KEY") ?? "";
var qs = string.Join("&", query.Select(p =>
$"{Uri.EscapeDataString(p.Key)}={Uri.EscapeDataString(p.Value)}"));
using var request = new HttpRequestMessage(method, $"{Api}/{path}?{qs}");
if (body is not null) request.Content = JsonContent.Create(body);
HttpResponseMessage response;
try
{
response = await http.SendAsync(request);
}
catch (HttpRequestException ex)
{
// Type name only: the URL carries the key, so no exception text in logs.
throw new ApiException($"{path}: network error ({ex.GetType().Name})");
}
catch (TaskCanceledException)
{
throw new ApiException($"{path}: timed out");
}
using (response)
{
if (response.StatusCode != HttpStatusCode.OK)
{
var status = (int)response.StatusCode;
throw new ApiException(
$"{path}: HTTP {status}, {Errors.GetValueOrDefault(status, "unexpected response")}");
}
try
{
return JsonNode.Parse(await response.Content.ReadAsStringAsync());
}
catch (JsonException)
{
throw new ApiException($"{path}: response wasn't JSON");
}
}
}
}
CallAsync never puts exception text into a message. On .NET 8, HttpClient's own exception messages leave the request URL out: I checked a refused connection, a DNS failure, and a timeout, and none of them contained the query string. Python's requests is the opposite and prints the full URL. The key still travels in the apiKey query parameter, though, so anything that logs request URIs logs the key. IHttpClientFactory does exactly that: with Microsoft.Extensions.Http 8.0.1, its handlers log the full URI, key included, twice per request at Information level, while 9.0.0 redacts the query string to ?*. This program uses a plain HttpClient, so neither applies.
The second block turns the route list into networks:
public static partial class ExitCheck
{
public static async Task<List<IPNetwork>> AnnouncedNetworksAsync(HttpClient http, string asn)
{
var data = await CallAsync(http, HttpMethod.Get, "asn",
new() { ["asn"] = asn, ["include"] = "routes" });
if (data is not JsonObject root || root["asn"] is not JsonObject info
|| info["routes"] is not JsonArray routes)
throw new ApiException("asn: no route list in the response");
var nets = new List<IPNetwork>();
foreach (var route in routes)
{
// Only a string like "165.119.0.0/16" counts; a number or null is a bad route.
if (route is not JsonValue value || !value.TryGetValue<string>(out var text)
|| !IPNetwork.TryParse(text, out var net))
throw new ApiException("asn: invalid prefix in route list");
nets.Add(net);
}
// Routes overlap (a /16 plus /24s inside it), so keep only the widest.
var kept = new List<IPNetwork>();
foreach (var net in nets.OrderBy(n => n.PrefixLength))
if (!kept.Any(k => k.Contains(net.BaseAddress)))
kept.Add(net);
return kept;
}
}
IPNetwork arrived in .NET 8, and it does both the parsing and the containment check. Sorting by prefix length and dropping any prefix already inside a kept one leaves 165.119.0.0/16 and 204.68.207.0/24 for AS2650. A route that isn't a string fails the check, and so does a prefix with host bits set such as 165.119.253.5/24, which IPNetwork.TryParse rejects. Either way the program stops trusting the route list, still checks the IPs, and exits 2.
Most offices don't have an ASN at all. If yours doesn't, skip this step: your firewall's NAT config, your ISP's assignment, and your cloud NAT settings are the list.
Step 2: Check the IPs your traffic leaves from
Start with the addresses your network actually sends traffic from, not the ranges you own on paper. If one shows up as a proxy exit, the flag isn't the problem: somewhere behind that address is a device running proxy software, and the fix is finding that device.
The arithmetic backs that order. Each address is one lookup, so a /24 is 256 lookups and all of 165.119.0.0/16 is 65,536. Your egress list (NAT gateways, guest Wi-Fi, VPN concentrators, the cloud NAT your CI runs behind) is usually a few dozen addresses. Pull it from the firewall config, not from memory.
The third block cleans that list and keeps one entry per address:
public static partial class ExitCheck
{
// Private, shared (CGNAT), loopback, link-local, documentation, benchmarking,
// multicast and reserved ranges. None of them is a public egress address.
static readonly IPNetwork[] NotPublic = new[]
{
"0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16",
"172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15",
"198.51.100.0/24", "203.0.113.0/24", "224.0.0.0/4", "240.0.0.0/4",
"::/127", "64:ff9b:1::/48", "100::/64", "2001::/23", "2001:db8::/32",
"fc00::/7", "fe80::/10", "ff00::/8",
}.Select(cidr => IPNetwork.Parse(cidr)).ToArray();
public static IPAddress? ParseIp(string text)
{
// IPAddress.TryParse accepts "8.8" (8.0.0.8), "010.0.0.1" (octal) and
// "[2001:db8::1]:80" (port dropped), so check the text form first.
if (!IPAddress.TryParse(text, out var ip)) return null;
if (ip.AddressFamily == AddressFamily.InterNetwork && ip.ToString() != text) return null;
if (ip.AddressFamily == AddressFamily.InterNetworkV6
&& !text.All(c => Uri.IsHexDigit(c) || c is ':' or '.')) return null;
return ip.IsIPv4MappedToIPv6 ? ip.MapToIPv4() : ip;
}
public static (List<IPAddress> Targets, int Skipped) ParseTargets(
IEnumerable<string> egress, List<IPNetwork> networks)
{
var targets = new List<IPAddress>();
var seen = new HashSet<IPAddress>();
var skipped = 0;
foreach (var raw in egress)
{
var ip = ParseIp(raw.Trim());
if (ip is null)
{
Log("WARNING", $"not an IP address: \"{raw}\"");
skipped++;
continue;
}
if (NotPublic.Any(n => n.Contains(ip)))
{
Log("WARNING", $"{ip} is private or reserved, so it isn't an egress IP");
skipped++;
continue;
}
if (networks.Count > 0 && !networks.Any(n => n.Contains(ip)))
{
// Often a provider-assigned address. Still worth checking.
Log("WARNING", $"{ip} is outside the prefixes your ASN announces");
}
// One lookup per address, however it's spelled.
if (seen.Add(ip)) targets.Add(ip);
}
return (targets, skipped);
}
}
Join the conversation! Your thoughts help the community grow.