From 8fa9d4b6956bada34045dfffad66b5f7fb724504 Mon Sep 17 00:00:00 2001 From: Osherz5 Date: Thu, 7 Nov 2024 20:08:55 +0200 Subject: [PATCH] Fix WinDivert filter syntax (#193) --- mitmproxy-windows/redirector/src/main2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy-windows/redirector/src/main2.rs b/mitmproxy-windows/redirector/src/main2.rs index 70c88781..632fa46b 100644 --- a/mitmproxy-windows/redirector/src/main2.rs +++ b/mitmproxy-windows/redirector/src/main2.rs @@ -115,7 +115,7 @@ async fn main() -> Result<()> { WinDivertFlags::new().set_recv_only().set_sniff(), )?; // WinDivert's syntax supports IP ranges (https://github.com/basil00/Divert/issues/250#issuecomment-723515347) - let wd_net_filter = "!loopback && ((ip && remoteAddr < 224.0.0.0) || (ip6 && remoteAddr < ff00::)) && (tcp || udp)"; + let wd_net_filter = "!loopback && ((ip && remoteAddr < 224.0.0.0) || (ipv6 && remoteAddr < ff00::)) && (tcp || udp)"; let network_handle = WinDivert::network(wd_net_filter, 1040, WinDivertFlags::new())?; let inject_handle = WinDivert::network("false", 1039, WinDivertFlags::new().set_send_only())?;