Tuesday, 1 October 2013

Recording and sending http requests using mitmproxy and mitmdump

  • Start mitmproxy
    $ mitmproxy -p 4444 -w localhost.requests
    
  • Set up your internal web proxy, on Mac OS this can be set up in the System Preferences application. Network > Advanced > Proxies > Web Proxy (HTTP), Your proxy must use localhost:4444
  • Now you are able to use your browser to record your requests
  • Using this command the recorded requests can be resent
  • $ mitmdump -nc localhost.requests
  • I had problems executing the last command in parallel in the same machine, I sorted this out choosing different ports, so it could run in parallel, the following script executes 100 instances of mitmdump
  • #! /bin/sh
    
    max=100
    for i in `seq 1 $max`
    do
        echo "$i"
        port=$((i + 9000))
        mitmdump -c localhost.requests -p $port &
    done