Command that can generates errors in the documentation

In the title _Work-around to redirect traffic originating from the machine itself_, add the flag `-H` to `sudo` command to avoid errors on certain Linux based OS.
This commit is contained in:
sidahmed-malaoui 2020-07-10 12:43:37 +01:00 committed by GitHub
parent 51b9ee109e
commit ef13270ff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,7 @@ Create a user to run the mitmproxy
```bash ```bash
sudo useradd --create-home mitmproxyuser sudo useradd --create-home mitmproxyuser
sudo -u mitmproxyuser bash -c 'cd ~ && pip install --user mitmproxy' sudo -u mitmproxyuser -H bash -c 'cd ~ && pip install --user mitmproxy'
``` ```
Then, configure the iptables rules to redirect all traffic from our local machine to mitmproxy. **Note**, as soon as you run these, you won't be able to perform successful network calls *until* you start mitmproxy. If you run into issues, `iptables -t nat -F` is a heavy handed way to flush (clear) *all* the rules from the iptables `nat` table (which includes any other rules you had configured). Then, configure the iptables rules to redirect all traffic from our local machine to mitmproxy. **Note**, as soon as you run these, you won't be able to perform successful network calls *until* you start mitmproxy. If you run into issues, `iptables -t nat -F` is a heavy handed way to flush (clear) *all* the rules from the iptables `nat` table (which includes any other rules you had configured).
@ -108,7 +108,7 @@ ip6tables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitmproxyuser --dport 4
This will redirect the packets from all users other than `mitmproxyuser` on the machine to mitmproxy. To avoid circularity, run mitmproxy as the user `mitmproxyuser`. Hence step **4** should look like: This will redirect the packets from all users other than `mitmproxyuser` on the machine to mitmproxy. To avoid circularity, run mitmproxy as the user `mitmproxyuser`. Hence step **4** should look like:
```bash ```bash
sudo -u mitmproxyuser bash -c '$HOME/.local/bin/mitmproxy --mode transparent --showhost --set block_global=false' sudo -u mitmproxyuser -H bash -c '$HOME/.local/bin/mitmproxy --mode transparent --showhost --set block_global=false'
``` ```