Skip to content

Instantly share code, notes, and snippets.

@JosephGregg
Created April 24, 2018 02:16
Show Gist options
  • Save JosephGregg/3e25c16b282dcfe0865694eb546d97db to your computer and use it in GitHub Desktop.
Save JosephGregg/3e25c16b282dcfe0865694eb546d97db to your computer and use it in GitHub Desktop.
ssh brute ...nah, son
-A SSH-IN -i enp4s0 -p tcp -m hashlimit --hashlimit-upto 2/min --hashlimit-burst 5 --hashlimit-mode srcip,dstport --hashlimit-name SSH_IN -m state --state NEW -m tcp --dport 22 -m comment --comment "Allow 2 new SSH connections per minute based on SRC IP and DST PORT" -j ACCEPT
-A SSH-IN -p tcp -m state --state NEW -m tcp --dport 22 -j LOG --log-prefix "IPTABLES SSH:"
-A SSH-IN -p tcp -m state --state NEW -m tcp --dport 22 -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment