Results 1 to 2 of 2

Thread: iptables not recognizing "--dport" or "--to-port" option

  1. #1
    Join Date
    2019-Oct
    Posts
    1

    Question iptables not recognizing "--dport" or "--to-port" option

    Hello, I've been attempting to redirect port 80 to port 8080 using iptables v1.8.3 to test an SSL strip MITM attack.
    I've entered the command: iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j REDIRECT --to-port 8080
    upon entering it gives me the error: unknown option "--dport" it also doesn't recognize the "--to-port" option. I'm running Kali on a Rasberry Pi 4B 4GB Does anyone know how I can resolve this? I haven't found anything useful on the web after three days of troubleshooting.

    cheers!
    -MichaelPV

  2. #2
    Join Date
    2016-Dec
    Posts
    806
    There is a typo in your rule preventing it from working: --to-ports (notice the s at the end) instead of --to-port
    Fixing that and the rule work just fine.

    Don't forget to have forwarding enabled (just in case the tutorial doesn't mention it)

Similar Threads

  1. Need advice on "Live" versus "Installed" custom builds
    By malakaldayook in forum Building Archive
    Replies: 3
    Last Post: 2017-10-03, 08:54

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •