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

推荐订阅源

博客园 - Franky
U
Unit 42
MyScale Blog
MyScale Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
量子位
IT之家
IT之家
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
V
Visual Studio Blog
G
Google Developers Blog
Last Week in AI
Last Week in AI
雷峰网
雷峰网
博客园 - 聂微东
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
博客园 - 司徒正美
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏

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.