TEXT   51

portknocking.txt

Guest on 11th May 2022 01:49:51 AM

  1. iptables -F
  2. iptables -X
  3. iptables -Z
  4. iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
  5. iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
  6. iptables -N port
  7. iptables -A port -m recent --name knock1 --remove
  8. iptables -A port -m recent --set --name knock2
  9.  
  10. iptables -A INPUT -p tcp --dport 168 -m recent --set --name knock1
  11.  
  12. iptables -A INPUT -p tcp --dport 978 -m recent --rcheck --name knock1 -j port
  13.  
  14. iptables -A INPUT -p tcp --dport 22 -m recent --rcheck --seconds 10 --name knock2 -j ACCEPT
  15. iptables -A INPUT -p tcp --dport 22 -j DROP
  16. /etc/init.d/networking restart

Raw Paste


Login or Register to edit or fork this paste. It's free.