我刚刚在我的 Ubuntu 10.04 服务器上安装了 fail2ban。
当我尝试启动客户端时,它返回:
错误 无法启动服务器。也许旧的套接字文件仍然存在。尝试删除 /var/run/fail2ban/fail2ban.sock。如果您使用 fail2ban-client 启动服务器,则添加 -x 选项即可
我删除了fail2ban.sock,但没有任何改变。我应该如何解决这个问题?
我已经在我的服务器上安装了 Fail2Ban。我计划在其上安装PSAD。他们平等吗?保留他们两个不是一个好主意吗?
可以运行 fail2ban某种“模拟模式”,因此它不会禁止但会在某处记录它会禁止的人?
在 Ubuntu 12.04 上运行 fail2ban。
这个问题与我的问题几乎相同,但接受的答案并不能解决我的问题
端口 22 上的 SSH 一切正常。5 次尝试后,fail2ban 从日志中读取并禁止我的 ip 600 秒。这是fail2ban日志
2013-07-10 11:54:08,522 fail2ban.actions: WARNING [ssh-iptables] Ban 192.168.162.191
2013-07-10 12:04:09,348 fail2ban.actions: WARNING [ssh-iptables] Unban 192.168.162.191
Run Code Online (Sandbox Code Playgroud)
我的 iptables,fail2ban 有端口 22
Chain INPUT (policy ACCEPT 1591 packets, 165K bytes)
pkts bytes target prot opt in out source destination
44 5292 fail2ban-SSH tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain …Run Code Online (Sandbox Code Playgroud) 我的 debian 服务器最近受到了攻击,我一直在仔细查看日志,看看我能做些什么来加强它。我已经运行 fail2ban 一段时间了,但我注意到 apache-noscript jail 似乎不起作用。fail2ban 包最近更新了,这个特定监狱的内容也发生了变化,但我不知道它以前是否有效。这是现在的监狱:
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
#
# $Revision: 728 $
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# common.local
before = apache-common.conf
[Definition]
# Option: failregex
# Notes.: regex to match the password failure messages in the logfile. The
# host must be matched by a group named "host". The tag "<HOST>" can
# be used for standard IP/hostname matching …Run Code Online (Sandbox Code Playgroud) 我只是尝试添加一个新的 fail2ban 规则,该规则应该扫描 Apache2 错误日志以查找可疑文件访问尝试(尝试访问三个不存在的常见登录 url 的人通常没有良好的意图)。
为此,我在 jail.local 文件中添加了一条新规则:
[apache-suspiciousfiles]
enabled = true
port = http,https
filter = apache-suspiciousfiles
banaction = iptables-allports
action = %(action_mwl)s
logpath = /var/log/apache2/error*.log
maxretry = 3
Run Code Online (Sandbox Code Playgroud)
然而,这在我的日志中给了我一个意外的错误消息:
2014-02-10 13:28:51,450 fail2ban.jail : INFO Jail 'apache-suspiciousfiles' started
2014-02-10 13:28:51,690 fail2ban.actions.action: ERROR iptables -N fail2ban-apache-suspiciousfiles
iptables -A fail2ban-apache-suspiciousfiles -j RETURN
iptables -I INPUT -p tcp -j fail2ban-apache-suspiciousfiles returned 200
Run Code Online (Sandbox Code Playgroud)
在那之前我已经用 fail2ban-regex 检查过过滤器,所以我很确定它不在那里。
(注:这里是“返回的200”,很多人好像对100有问题,但是这个是200左右)
我使用 fail2ban 运行 CentOS 5 服务器,目前我的 dovecot 服务遭到暴力攻击。
我知道fail2ban 正在工作,因为它阻止了对我的FTP 服务器和Postfix 的攻击。出于某种原因,我错过了 dovecot 的一些东西,因为 fail2ban 日志中没有任何内容,并且攻击继续有增无减。
我的日志如下。Dovecot 将所有内容记录到 - /var/log/dovecot-info.log
我看到两种类型的日志。第一个看起来像这样(注意:我的服务器 Ip 没问题 - 我已经用 xxx.xxx.xxx 屏蔽了更精细的细节):
Feb 22 21:48:21 pop3-login: Info: Aborted login (auth failed, 1 attempts): user=<felix>, method=PLAIN, rip=177.19.151.139, lip=173.xxx.xxx.xxx
Feb 22 21:48:23 auth: Info: passwd-file(felipe,177.19.151.139): unknown user
Feb 22 21:48:25 pop3-login: Info: Aborted login (auth failed, 1 attempts): user=<felipe>, method=PLAIN, rip=177.19.151.139, lip=173.xxx.xxx.xxx
Feb 22 21:48:29 auth: Info: passwd-file(felix,177.19.151.139): unknown user
Feb 22 21:48:31 pop3-login: Info: Aborted login …Run Code Online (Sandbox Code Playgroud) 我们的服务器被 HEAD 请求淹没。
这导致 TCP 连接数激增,导致服务器无法连接到其 mysql 数据库。
我们广泛使用 nginx 速率限制,它与fail2ban 完美结合,适用于任何 GET 和 POST 请求。然而,HEAD 请求似乎没有被接受。
我们使用的fail2ban filter.d 操作似乎nginx-limit-req是一个库存配置,用于检测何时达到nginx 区域限制。
由于我们的 Web 应用程序不需要 HEAD 请求,因此我们有两个选择(除了手动禁止单个 IP 地址之外)
nginx.conf:
http {
...
limit_req_zone "$http_x_forwarded_for" zone=web_zone:50m rate=2r/s;
...
}
server {
...
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
location / {
limit_req zone=web_zone burst=25;
try_files $uri $uri/ @pretty-urls;
}
...
}
Run Code Online (Sandbox Code Playgroud)
监狱.conf:
[nginx-limit-req]
enabled = true
filter = nginx-limit-req
action = custom-iptables-proxy …Run Code Online (Sandbox Code Playgroud) Ubuntu 服务器 9.10
嗨,大家好,
我认为这是一个简单的......我正在尝试安装fail2ban并收到以下错误:
$ sudo apt-get install fail2ban
Reading package lists...
Done Building dependency tree Reading state information...
Done E: Couldn't find package fail2ban
Run Code Online (Sandbox Code Playgroud)
我需要启用哪些存储库才能安装它?
我目前在 sources.list 中启用了以下功能
deb http://us.archive.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic main restricted
deb http://security.ubuntu.com/ubuntu karmic-security main restricted
deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted
deb http://security.ubuntu.com/ubuntu karmic-security universe
deb-src http://security.ubuntu.com/ubuntu karmic-security universe
deb http://security.ubuntu.com/ubuntu karmic-security multiverse
deb-src http://security.ubuntu.com/ubuntu karmic-security multiverse
deb http://de.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://de.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ …Run Code Online (Sandbox Code Playgroud) 下面是fail2ban日志的输出。什么都没有显示,但在 auth.log 中,我看到 root 用户登录失败了数百次(有人是个坏蛋蛮力强行者)。
2011-07-06 01:48:16,249 fail2ban.server : INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.8.3
2011-07-06 01:48:16,250 fail2ban.jail : INFO Creating new jail 'ssh'
2011-07-06 01:48:16,250 fail2ban.jail : INFO Jail 'ssh' uses poller
2011-07-06 01:48:16,251 fail2ban.filter : INFO Added logfile = /var/log/auth.log
2011-07-06 01:48:16,252 fail2ban.filter : INFO Set maxRetry = 3
2011-07-06 01:48:16,253 fail2ban.filter : INFO Set findtime = 600
2011-07-06 01:48:16,253 fail2ban.actions: INFO Set banTime = 600
2011-07-06 01:48:16,329 fail2ban.jail : INFO Jail 'ssh' started
Run Code Online (Sandbox Code Playgroud)
为什么不阻止他们?我没有更改配置中的任何内容(除了 …
fail2ban ×10
iptables ×2
linux ×2
security ×2
ubuntu ×2
apache-2.2 ×1
centos ×1
centos6 ×1
debian ×1
debian-lenny ×1
dovecot ×1
nginx ×1
psad ×1
ssh ×1
ubuntu-12.04 ×1