Skip to content
Liana Lo edited this page Jan 8, 2015 · 7 revisions

If required, users can utilize mitmproxy to access secured domains.

Proxy features have only been optimized to run on Raspbian devices that do not require a password for sudo commands.

mitmproxy

Install mitmproxy on the proxy device.

Edit proxyConfig.py in src/proxy/proxy. The script should contain the following,

DOMAIN = "secret.com"
AUTHORIZATION_HEADER = "secret"

def request(context, flow):
    if flow.request.pretty_host(hostheader=True).endswith(DOMAIN):
        flow.request.headers["Authorization"] = [AUTHORIZATION_HEADER]

Set DOMAIN with the target domain and AUTHORIZATION_HEADER with your header string.

Run mitmproxy with the command

$ mitmproxy -s proxyConfig.py 

Then start proxy.go to manage the proxy device's iptables. Pass the master's IP address and port number as flags. For example,

$ proxy.go -masterIP=10.0.0.180 -masterPort=5000

Slave

Install your mitmproxy's certificate authority on the slave device.

Configure the slave device to use the proxy as a default gateway or configure the device to forward all HTTP/HTTPS requests to the proxy.

At slave start up, configure the slaves with the flag -proxyURL=[proxy_IP_address]:8080. By default, mitmproxy runs on port 8080.