Advertisement
swaggboi

Untitled

Jan 18th, 2019
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.41 KB | None | 0 0
  1. # OLD - IPv4 only but works
  2. # sshd rate-limiting
  3. $IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 22 -m state \
  4.             --state NEW -m recent --update --seconds 600 --hitcount 5 -j LOG \
  5.                 --log-prefix "sshd rate-limit: "
  6. $IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 22 -m state \
  7.             --state NEW -m recent --update --seconds 600 --hitcount 5 -j DROP
  8. $IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 22 -m state \
  9.                 --state NEW -m recent --set
  10.  
  11. # NEW - dual stack but not working?
  12. # sshd rate-limiting
  13. $IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 22 -m state \
  14.             --state NEW -m recent --update --seconds 600 --hitcount 5 -j LOG \
  15.                 --log-prefix "sshd rate-limit: "
  16. $IP6T -A tcp_inbound -p TCP -s ::/0 --destination-port 22 -m state \
  17.             --state NEW -m recent --update --seconds 600 --hitcount 5 -j LOG \
  18.                 --log-prefix "sshd rate-limit: "
  19. $IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 22 -m state \
  20.             --state NEW -m recent --update --seconds 600 --hitcount 5 -j DROP
  21. $IP6T -A tcp_inbound -p TCP -s ::/0 --destination-port 22 -m state \
  22.             --state NEW -m recent --update --seconds 600 --hitcount 5 -j DROP
  23. $IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 22 -m state \
  24.             --state NEW -m recent --set
  25. $IP6T -A tcp_inbound -p TCP -s ::/0 --destination-port 22 -m state \
  26.             --state NEW -m recent --set
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement