question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mitmdump filter does not apply to saved dumps

See original GitHub issue
Steps to reproduce the problem:
  1. Install mitmproxy on Debian Jessie from git following the steps from here and here
  2. Run mitmproxy -w somefile and connect a device to it as usual
  3. Press oI and add .* to the list of ignore patterns
  4. Hit qq and see connections from your device still appearing in the interface.
What is the expected behavior?

mitmproxy interface should behave as if there were no connections going through it, e.g. the interface should not display them and they should not be stored in the dump file.

What went wrong?

mitmproxy ignored --ignore patterns.

Any other comments?

$ mitmproxy --version mitmproxy 0.18

I have built mitmproxy with the latest commit being this one.


Mitmproxy Version: https://github.com/mitmproxy/mitmproxy/commit/423c076c61140c2e953313793263a4cac71e33ca Operating System: Debian Jessie ARM

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dnikucommented, Apr 26, 2016

Thank you.

For posterity, this is how I solved my problem:

mitmdump -w mitm_$(date +%Y-%m-%d_%H-%M-%S) --ignore '(?!domain_regex)' '~d domain_regex'

Both options are required. The first one is responsible for not intercepting unrelated connections (so that, for example, Play Store do not cease to work), and the second one forces mitmdump to write only the flows to this domain into the log.

0reactions
mhilscommented, Apr 29, 2016

Thanks again. This is fixed on master now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Options - mitmproxy docs
Name Type Description # allow_hosts mitmproxy mitmdump mitmweb sequence of str Opposite of ‑‑ignore‑hosts... # client_replay mitmproxy mitmdump mitmweb sequence of str Replay client requests...
Read more >
Examples - mitmproxy docs
Example: io-read-saved-flows.py. #!/usr/bin/env python """ Read a mitmproxy dump file. """ from mitmproxy import io, http from mitmproxy.exceptions import ...
Read more >
Filter expressions - mitmproxy docs
Many commands in the mitmproxy tool make use of filter expressions. ... Strings with no operators are matched against the request URL.
Read more >
Save traffic in pcap file or best way to log post data - mitmproxy
With option -w/-a all html traffic is logged, we can replay it with ... by using mitmdump's filter argument: mitmdump -w dump.mitm '~m...
Read more >
Show flow from one IP address - help - mitmproxy
Hi I read mitmproxy flow from file mitmproxy -r logs_mitm.dump how to display flow ... You can use our filter syntax in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found