Created
December 3, 2024 17:47
-
-
Save ZeroClover/146ffb8566657fa6cca895d1120856bb to your computer and use it in GitHub Desktop.
NFTables Honeypot Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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