Skip to content

Instantly share code, notes, and snippets.

@SBejga
Created April 28, 2015 09:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SBejga/5c5feb70324a8c9626d3 to your computer and use it in GitHub Desktop.
Save SBejga/5c5feb70324a8c9626d3 to your computer and use it in GitHub Desktop.
Honeypot with iptables on port 23
#!/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
@SBejga
Copy link
Author

SBejga commented Apr 28, 2015

syntax was changed of ip negotiation. Negotiation has to be in front of parameter (e.g. -s; means: ! -s )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment