NightStalker Posted January 3, 2014 Share Posted January 3, 2014 I am using Kali 1.05 and for some reason when I enter an IPTables rule such as below it does not save or show up when I list the rules: =========================================================================== root@kali:~# iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000 root@kali:~# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination =========================================================================== Just for giggles I did try with the sudo command but still nothing. Am I missing something stupid? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
hexophrenic Posted January 3, 2014 Share Posted January 3, 2014 Perhaps the service is not running? Quote Link to comment Share on other sites More sharing options...
NightStalker Posted January 3, 2014 Author Share Posted January 3, 2014 It does show running and the funnier part is when I do an iptables-save I see the line in the config: =========================================================================== root@kali:~# iptables-save # Generated by iptables-save v1.4.14 on Fri Jan 3 10:38:42 2014 *nat :PREROUTING ACCEPT [1:52] :INPUT ACCEPT [1:52] :OUTPUT ACCEPT [8:1016] :POSTROUTING ACCEPT [8:1016] -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 10000 COMMIT # Completed on Fri Jan 3 10:38:43 2014 # Generated by iptables-save v1.4.14 on Fri Jan 3 10:38:43 2014 *filter :INPUT ACCEPT [392:37336] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [252:46598] COMMIT # Completed on Fri Jan 3 10:38:43 2014 =========================================================================== Quote Link to comment Share on other sites More sharing options...
NightStalker Posted January 5, 2014 Author Share Posted January 5, 2014 Well I knew it was going to be stupid, probably my more lack of knowledge of IPTables. I noticed when I added something to the INPUT chain it showed and when I did the iptables-save command I saw the NAT there. So I searched more and found that PREROUTING was just hidden in the iptables -L command. When I changed it to include the NAT: =========================================================================== root@kali:~# iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000 root@kali:~# iptables -t nat --list Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 10000 Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination root@kali:~# =========================================================================== Hopefully this will help someone else with the same lack of knowledge I had :) NightStalker Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.