- Welcome to the mitmproxy tutorial. In this lesson we cover the interception of requests.
- We first need to configure mitmproxy to intercept requests.
ito prepopulate mitmproxy’s command prompt with
set intercept ''.
- We use the flow filter expression
~u <regex>to only intercept specific URLs.
- Additionally, we use the filter
~qto only intercept requests, but not responses.
- We combine both flow filters using
~u /Dunedin & ~qbetween the quotes of the
set interceptcommand and press
- The bottom bar shows that the interception has been configured.
- Let’s generate a request using
curlin a separate terminal.
- You see a new line in in the list of flows.
- The new flow is displayed in red to indicate that it has been intercepted.
- Put the focus (
>>) on the intercepted flow. This is already the case in our example.
ato resume this flow without making any changes.
- Submit another request and focus its flow.
Xto kill this flow, i.e., discard it without forwarding it to its final destination
- In the next lesson you will learn to modify intercepted flows.