2011-08-04 22:23:32 +00:00
|
|
|
|
|
|
|
__mitmdump__ is the command-line companion to mitmproxy. It provides
|
|
|
|
tcpdump-like functionality to let you view, record, and programmatically
|
2012-04-04 04:05:18 +00:00
|
|
|
transform HTTP traffic. See the _--help_ flag output for complete
|
2011-08-04 22:23:32 +00:00
|
|
|
documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Example: saving traffic
|
|
|
|
|
2011-08-05 01:26:39 +00:00
|
|
|
<pre class="terminal">
|
2011-08-06 01:19:46 +00:00
|
|
|
> mitmdump -w outfile
|
2011-08-05 01:26:39 +00:00
|
|
|
</pre>
|
2011-08-04 22:23:32 +00:00
|
|
|
|
|
|
|
Start up mitmdump in proxy mode, and write all traffic to __outfile__.
|
|
|
|
|
|
|
|
|
|
|
|
## Example: client replay
|
|
|
|
|
2011-08-05 01:26:39 +00:00
|
|
|
<pre class="terminal">
|
2011-08-06 01:19:46 +00:00
|
|
|
> mitmdump -nc outfile
|
2011-08-05 01:26:39 +00:00
|
|
|
</pre>
|
2011-08-04 22:23:32 +00:00
|
|
|
|
|
|
|
Start mitmdump without binding to the proxy port (_-n_), then replay all
|
|
|
|
requests from outfile (_-c filename_). Flags combine in the obvious way, so
|
|
|
|
you can replay requests from one file, and write the resulting flows to
|
|
|
|
another:
|
|
|
|
|
2011-08-05 01:26:39 +00:00
|
|
|
<pre class="terminal">
|
2011-08-06 01:19:46 +00:00
|
|
|
> mitmdump -nc srcfile -w dstfile
|
2011-08-05 01:26:39 +00:00
|
|
|
</pre>
|
2011-08-04 22:23:32 +00:00
|
|
|
|
|
|
|
See the [Client-side Replay](@!urlTo("clientreplay.html")!@) section for more information.
|
|
|
|
|
|
|
|
|
|
|
|
## Example: running a script
|
|
|
|
|
2011-08-05 01:26:39 +00:00
|
|
|
<pre class="terminal">
|
2011-08-06 01:19:46 +00:00
|
|
|
> mitmdump -s examples/add_header.py
|
2011-08-05 01:26:39 +00:00
|
|
|
</pre>
|
2011-08-04 22:23:32 +00:00
|
|
|
|
|
|
|
This runs the __add_header.py__ example script, which simply adds a new header
|
|
|
|
to all responses.
|
|
|
|
|
|
|
|
|
|
|
|
## Example: scripted data transformation
|
|
|
|
|
2011-08-05 01:26:39 +00:00
|
|
|
<pre class="terminal">
|
2011-08-06 01:19:46 +00:00
|
|
|
> mitmdump -ns examples/add_header.py -r srcfile -w dstfile
|
2011-08-05 01:26:39 +00:00
|
|
|
</pre>
|
2011-08-04 22:23:32 +00:00
|
|
|
|
|
|
|
This command loads flows from __srcfile__, transforms it according to the
|
|
|
|
specified script, then writes it back to __dstfile__.
|
|
|
|
|