Chapter 1: Introduction
- What this book covers
- Who this book is for
- How to use this book
- A note on versions and commands
- Getting Started
Chapter 2: Installing mitmproxy 12.2.3
- Installation on Linux, macOS, and Windows
- Verifying the installation
- First run: what lands in ~/.mitmproxy
- Upgrading and uninstalling
Chapter 3: The Three Frontends
- mitmproxy: the interactive TUI
- mitmweb: the web interface
- mitmdump: the scriptable CLI
- Shared command-line options
- Interception and Inspection
Chapter 4: How mitmproxy Intercepts HTTPS
- The proxy core and sans-I/O design
- TLS termination and certificate generation
- The mitmproxy CA and trust stores
- What interception cannot see
Chapter 5: Trusting the mitmproxy CA
- Installing the CA on Linux
- Installing the CA on macOS and Windows
- Browsers and runtimes with their own trust store
- Troubleshooting CA trust
Chapter 6: Filter Expressions and Flow Inspection
- Filter expression syntax
- Common filter patterns
- Inspecting flows in the TUI
- Inspecting flows in mitmweb
- Modification and Replay
Chapter 7: Modifying Requests and Responses
- Interactive modification in the TUI
- modify_headers, modify_body, map_local and map_remote
- Modification with addons
- Common modification recipes
Chapter 8: Replaying Requests
- Client-side replay
- Server-side replay
- Replay in mitmweb
- Replay caveats and pitfalls
- Addon Development
Chapter 9: Addon Architecture and Events
- Anatomy of an addon
- Event hooks and their order
- Loading and running addons
- The abbreviated scripting syntax
Chapter 10: Options, Commands, and Hooks
- Declaring addon options
- Defining custom commands
- Custom contentviews
- Exposing addons in the UI
Chapter 11: Working with Flows and Messages
- The flow object model
- HTTP request and response objects
- Headers, cookies and bodies
- Reading flow files from Python
- Deployment Modes
Chapter 12: Choosing a Mode: Regular, Transparent and Reverse
- The mode specification syntax
- Choosing a mode for your task
- Regular proxy mode
- Transparent mode on Linux
- Transparent mode on macOS
- Reverse proxy mode
Chapter 13: Upstream, SOCKS, and WireGuard Modes
- Upstream proxy mode
- SOCKS proxy mode
- WireGuard mode
- Combining modes
Chapter 14: Local Capture Mode
- Local redirect on Linux
- Local redirect on macOS
- Local redirect on Windows
- Capturing Docker containers
- Mobile and Advanced Protocols
Chapter 15: Intercepting Android and iOS Apps
- Android emulator setup
- Installing the CA as a system certificate
- Android 14 and newer CA installation
- Physical Android devices
- WireGuard for Android apps
- Emulator networking and localhost
- iOS proxy and CA setup
- Full trust for TLS on iOS
Chapter 16: Bypassing Certificate Pinning
- What certificate pinning is
- Frida and objection basics
- Universal unpinning scripts
- Pinning on iOS
- Pinning bypass caveats
Chapter 17: HTTP/2, HTTP/3, and WebSockets
- HTTP/2 interception
- HTTP/3 and QUIC
- WebSocket message handling
- Protocol-specific addon events
- Automation and Reference
Chapter 18: Exporting Flows: HAR, curl and OpenAPI
- Saving and loading flow files
- Streaming large transfers
- Exporting HAR
- Copying requests as curl and raw
- From flows to an OpenAPI spec
Chapter 19: Automating API Security Testing
- A harness you drive with addons
- Building a fuzzing addon
- Automated replay and regression
- Auth token rotation
- Reporting what the tests found
Chapter 20: Conclusion
- What you can now do
- Where to go next
- Keeping current with mitmproxy
Appendix A: Command-line options reference
- How options reach the tools
- Invocation and file I/O
- Proxy modes and listeners
- TLS and certificates
- Modification and replay
- Protocol and bodies
- Frontend-specific flags
- Environment variables
Appendix B: Filter expression reference
- Operators
- Combining expressions
- Regex arguments
- Flow selectors
- Where filters apply
Appendix C: Addon event reference
- Addon event reference
Appendix D: Flow export formats
- At a glance
- The .mitm flow file
- HAR (HTTP Archive)
- Export commands: curl, HTTPie, raw
- OpenAPI 3.0 through mitmproxy2swagger
