Unable to redirect ports with iptables

Hi,

I have been unable to redirect with iptables to port 10000, I have been looking into documentations online as well as forumes and it seems that nothing helps.

I have been trying to do that with this command :
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-port 10000

I also tried for port 80, but it did not worked neither. I am really stuck.

Thanks in advance for your help.

You need to add the ip address for destination

Can you give me an example?

Hi @yuval, sorry for the late reply. I think you need to specify the interface also. An example would be this iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 2525. Here the interface is eth0. Look up your interface using ifconfig or ip a and replace it in this command and edit accordingly.

@Apurv-StationX I also tried that, and didn’t work. It’s in the part of bypassing https using sslstrip. maybe all of this is dupricated ?