Skip to content

Instantly share code, notes, and snippets.

@Dliv3
Last active January 28, 2019 13:35
Show Gist options
  • Save Dliv3/4bb82fd1f7745b5df07e4a47507c594d to your computer and use it in GitHub Desktop.
Save Dliv3/4bb82fd1f7745b5df07e4a47507c594d to your computer and use it in GitHub Desktop.
# https://www.freebuf.com/articles/network/137683.html
# 端口复用链
iptables -t nat -N LETMEIN
# 端口复用规则
iptables -t nat -A LETMEIN -p tcp -j REDIRECT --to-port 22
# 开启开关
iptables -A INPUT -p tcp -m string --string 'threathuntercoming' --algo bm -m recent --set --name letmein --rsource -j ACCEPT
# 关闭开关
iptables -A INPUT -p tcp -m string --string 'threathunterleaving' --algo bm -m recent --name letmein --remove -j ACCEPT
# let's do it
iptables -t nat -A PREROUTING -p tcp --dport 80 --syn -m recent --rcheck --seconds 3600 --name letmein --rsource -j LETMEIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment