I am trying to do something very simple. I am trying to force all web request to go to my local webserver. I start by activating said webserver on my Kali Linux VirtualBox machine
sudo systemctl start apache2
Then I redirect all web traffic with iptables
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 127.0.0.1:80 sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:80
Check to make sure the changes took effect
sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination DNAT tcp -- anywhere anywhere tcp dpt:https to:127.0.0.1:80
Now when I go to google.com or even example.com I just go to google.com as I normally would. How can I make the changes actually take effect?