2013-10-30 13:21:30 +00:00
|
|
|
# Fail2Ban filter for dropbear
|
2011-03-23 20:36:08 +00:00
|
|
|
#
|
2013-10-30 13:21:30 +00:00
|
|
|
# NOTE: The regex below is ONLY intended to work with a patched
|
|
|
|
# version of Dropbear as described here:
|
|
|
|
# http://www.unchartedbackwaters.co.uk/pyblosxom/static/patches
|
|
|
|
# ^%(__prefix_line)sexit before auth from <HOST>.*\s*$
|
2011-03-23 20:36:08 +00:00
|
|
|
#
|
2013-10-30 13:21:30 +00:00
|
|
|
# The standard Dropbear output doesn't provide enough information to
|
|
|
|
# ban all types of attack. The Dropbear patch adds IP address
|
|
|
|
# information to the 'exit before auth' message which is always
|
|
|
|
# produced for any form of non-successful login. It is that message
|
|
|
|
# which this file matches.
|
2011-03-23 20:36:08 +00:00
|
|
|
#
|
|
|
|
# More information: http://bugs.debian.org/546913
|
|
|
|
|
|
|
|
[INCLUDES]
|
|
|
|
|
|
|
|
# Read common prefixes. If any customizations available -- read them from
|
|
|
|
# common.local
|
|
|
|
before = common.conf
|
|
|
|
|
|
|
|
[Definition]
|
|
|
|
|
|
|
|
_daemon = dropbear
|
|
|
|
|
2013-11-12 07:06:16 +00:00
|
|
|
failregex = ^%(__prefix_line)s[Ll]ogin attempt for nonexistent user ('.*' )?from <HOST>:\d+$
|
|
|
|
^%(__prefix_line)s[Bb]ad (PAM )?password attempt for .+ from <HOST>(:\d+)?$
|
2013-10-30 13:21:30 +00:00
|
|
|
^%(__prefix_line)s[Ee]xit before auth \(user '.+', \d+ fails\): Max auth tries reached - user '.+' from <HOST>:\d+\s*$
|
2011-03-23 20:36:08 +00:00
|
|
|
|
2013-10-30 13:21:30 +00:00
|
|
|
ignoreregex =
|
2011-03-23 20:36:08 +00:00
|
|
|
|
2013-10-30 13:21:30 +00:00
|
|
|
# DEV Notes:
|
2011-03-23 20:36:08 +00:00
|
|
|
#
|
2013-10-30 13:21:30 +00:00
|
|
|
# The first two regexs here match the unmodified dropbear messages. It isn't
|
|
|
|
# possible to match the source of the 'exit before auth' messages from dropbear
|
|
|
|
# as they don't include the "from <HOST>" bit.
|
2011-03-23 20:36:08 +00:00
|
|
|
#
|
2013-10-30 13:21:30 +00:00
|
|
|
# The second last failregex line we need to match with the modified dropbear.
|
|
|
|
#
|
2013-11-12 07:06:16 +00:00
|
|
|
# For the second regex the following apply:
|
|
|
|
#
|
|
|
|
# http://www.netmite.com/android/mydroid/external/dropbear/svr-authpam.c
|
|
|
|
# http://svn.dd-wrt.com/changeset/16642#file64
|
|
|
|
#
|
|
|
|
# http://svn.dd-wrt.com/changeset/16642/src/router/dropbear/svr-authpasswd.c
|
|
|
|
#
|
2013-10-30 13:21:30 +00:00
|
|
|
# Author: Francis Russell
|
|
|
|
# Zak B. Elep
|