Created
April 28, 2015 09:59
-
-
Save SBejga/5c5feb70324a8c9626d3 to your computer and use it in GitHub Desktop.
Honeypot with iptables on port 23
This file contains 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
#!/bin/sh | |
HP_IPT='/sbin/iptables' | |
HP_Port=23 | |
HP_Time=600 | |
$HP_IPT -N honeypot | |
$HP_IPT -A INPUT ! -s 127.0.0.1 -j honeypot | |
$HP_IPT -A honeypot -m recent --update --seconds $HP_Time --name portscan -j DROP | |
$HP_IPT -A honeypot -p tcp -m tcp --dport $HP_Port -m recent --name portscan --set -j LOG --log-prefix "IPTABLES -- HONEYPOT -- P $HP_Port " --log-level 6 --log-ip-options | |
$HP_IPT -A honeypot -p tcp -m tcp --dport $HP_Port -m recent --name portscan --set -j DROP | |
$HP_IPT -A honeypot -j RETURN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
syntax was changed of ip negotiation. Negotiation has to be in front of parameter (e.g. -s; means: ! -s )