惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
S
SegmentFault 最新的问题
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
I
InfoQ
U
Unit 42
博客园_首页
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
罗磊的独立博客
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
DataBreaches.Net
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 聂微东
T
Tailwind CSS Blog
量子位

Posts on mitmproxy.org

Mitmproxy 12: Interactive Contentviews Intercepting Linux Applications Mitmproxy 11: Full HTTP/3 Support Mitmproxy 10.4: Mitmweb Capture Tab Intercepting macOS Applications Mitmproxy 10.1: HAR Support Mitmproxy 10: First Bits of HTTP/3! A more user-friendly transparent mode, based on WireGuard Mitmproxy 9 Mitmproxy 8 Google Summer of Code 2021 Mitmproxy 7 A New Proxy Core, Sans I/O Mitmproxy 6 Mitmproxy 5.3 Mitmproxy 5.2 Mitmproxy 5 Mitmproxy 4 Google Summer of Code 2018 Mitmproxy 3
Intercepting Windows Applications
Maximilian Hils · 2024-01-04 · via Posts on mitmproxy.org
04 Jan 2024,

We’re excited to share that local redirect mode is now available on Windows in mitmproxy 10.2! This allows users to seamlessly intercept local applications without configuring proxy settings.

Local Redirect Mode, One Platform at a Time

While mitmproxy’s traditional proxying modes are all relatively platform-independent, our new effort to transparently redirect traffic from the local machine is not. After debuting local redirect mode for macOS last month, we’re happy to report that our Windows functionality is now ready for testing, too!

While limited to CLI invocations for now, this paves the path for significant usability improvements going forward. As on macOS, you can try out local redirect mode as follows:

# Capture all local traffic
mitmproxy --mode local
# Capture cURL only
mitmproxy --mode local:curl

How it works

Packet Redirection on Windows

Packet Redirection on Windows

While macOS provided us with relatively nice system APIs for traffic redirection (let’s not get into the associated code-signing nightmares here), Windows does not have an equivalent to this. Instead of handling TCP streams as on macOS, we capture individual packets and need to handle TCP reassembly ourselves.

To capture packets, mitmproxy spawns a privileged redirector process that makes use of WinDivert, a user-mode packet capture library, via the excellent windivert-rust crate. This allows us to target specific PIDs while avoiding memory-unsafe code on our end.

When the redirector has determined that a particular packet needs to be intercepted, it is passed through a named pipe to mitmproxy_rs. Here we re-use our existing user-space TCP/IP stack to transform packets into streams, and then pass them on to mitmproxy.

Next Steps

Local redirect mode for Windows is now available for users in mitmproxy 10.2. We still intend to extend it with automated certificate installation, and more importantly a UI integration into mitmweb. If you are curious about contributing, please join us on GitHub!

Acknowledgments

This work supported by the NGI0 Entrust fund established by NLnet.