You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
566 B

  1. #/bin/bash
  2. #
  3. echo Adding nat iptables rules to route traffic through mitmproxy..
  4. sudo iptables -t nat -A PREROUTING -i enp0s8 -p tcp --dport 80 -j REDIRECT --to-port 8080
  5. sudo iptables -t nat -A PREROUTING -i enp0s8 -p tcp --dport 443 -j REDIRECT --to-port 8080
  6. echo Adding redirect to real server rules..
  7. REDIRECT_IP=157.240.2.35
  8. sudo iptables -t nat -A OUTPUT -p tcp -d 192.168.2.2 --destination-port 80 -j DNAT --to-destination $REDIRECT_IP
  9. sudo iptables -t nat -A OUTPUT -p tcp -d 192.168.2.2 --destination-port 443 -j DNAT --to-destination $REDIRECT_IP