Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. #politque par defaut
  4. iptables -P INPUT DROP
  5. iptables -P FORWARD DROP
  6. iptables -P OUTPUT DROP
  7.  
  8. # creation chaine TCP IN OUT
  9. iptables -N TCPIFG
  10. iptables -N TCPOFG
  11. iptables -A OUTPUT -p tcp -j TCPOFG
  12. iptables -A INPUT -p tcp -j TCPIFG
  13.  
  14. #creation chaine UDP IN OUT
  15. iptables -N UDPIFG
  16. iptables -N UDPOFG
  17. iptables -A OUTPUT -p udp -j UDPOFG
  18. iptables -A INPUT -p udp -j UDPIFG
  19.  
  20. # autoriser 22 et 21
  21. iptables -A TCPIFG -p tcp --dport 21 -j ACCEPT
  22. iptables -A TCPIFG -p tcp --dport 22 -j ACCEPT
  23. # Permerttre retour
  24. iptables -A TCPIFG -m state --state RELATED,ESTABLISHED -j ACCEPT
  25. iptables -A TCPOFG -m state --state RELATED,ESTABLISHED -j ACCEPT
  26.  
  27. #Autoriser dns
  28. iptables -A UDPIFG -p udp --dport 53 -j ACCEPT
  29. iptables -A UDPOFG -p udp --sport 53 -j ACCEPT
  30.  
  31. #bloque microsoft
  32. iptables -A TCPIFG -p tcp -m multiport --dports netbios-ns,netbios-dgm,netbios-ssn,microsoft-ds,bootps,bootpc -j DROP
  33. iptables -A UDPIFG -p udp -m multiport --dports netbios-ns,netbios-dgm,netbios-ssn,microsoft-ds,bootps,bootpc -j DROP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement