Skip to content

Instantly share code, notes, and snippets.

@ZeroClover
Created December 3, 2024 17:47
Show Gist options
  • Select an option

  • Save ZeroClover/146ffb8566657fa6cca895d1120856bb to your computer and use it in GitHub Desktop.

Select an option

Save ZeroClover/146ffb8566657fa6cca895d1120856bb to your computer and use it in GitHub Desktop.
NFTables Honeypot Example
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
set honeypot_ipv4 {
type ipv4_addr
flags dynamic,timeout
timeout 1d
}
chain input {
type filter hook input priority 0;
iifname "lo" return
ip saddr @honeypot_ipv4 counter drop
tcp dport 22 add @honeypot_ipv4 { ip saddr timeout 1d }
}
chain forward {
type filter hook forward priority 0;
}
chain output {
type filter hook output priority 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment