突然有些人或电脑正在尝试login我的linux directadmin服务器。
最近几天,我在Direct Admin中收到很多Exim2蛮力攻击的消息。
我已经在服务器上安装了Fail2Ban&Block_IP.SH。
所以如果用户失败15次login,那么IP地址将被阻止。
我怎样才能阻止攻击继续,所以电脑不会再尝试login?

这是一个写得不好的分布式机器人。 据我可以告诉这些主机正在尝试通过未encryption的连接进行身份validation。 如果您需要安全连接进行身份validation,则甚至会失败。 但是,看起来您允许在未encryption的连接上进行身份validation。
默认情况下, fail2ban将会错过这个条件,但是在10分钟内3次尝试后会阻塞。 您可以创build一个jail.local文件来调整fail2ban要求的失败次数或者增加禁止时间。 fail2ban-client还允许您在服务器运行时调整configuration。 您可能需要在filter.d创build一个exim.local文件,以匹配正在生成的行。 我已经包含了我的exim.local的内容。 你可以使用fail2ban-regex来testing正则expression式(你将需要在正则expression式中replacepython包含)。
[Definition] host_info = H=([\w.-]+ )?(\(\S+\) )?\[<HOST>\](:\d+)? ?(I=\[\S+\]:\d+ )?(U=\S+ )?(P=e?smtp )? failregex = ^%(pid)s %(host_info)s [^:]+: Sender host address is listed in zen.spamhaus.org ^%(pid)s %(host_info)s sender verify fail for <\S+>: (?:Unknown user|Unrouteable address|all relevant MX records point to non-existent hosts)\s*$ ^%(pid)s (plain|login) authenticator failed for (\S+ )?\(\S+\) \[<HOST>\]: 535 Incorrect authentication data( \(set_id=.*\)|: \d+ Time\(s\))?\s*$ ^%(pid)s %(host_info)s F=(<>|[^@]+@\S+) rejected RCPT [^@]+@\S+: (relay not permitted|Sender verify failed|Unknown user)\s*$ ^%(pid)s SMTP protocol synchronization error \([^)]*\): rejected (connection from|"\S+") %(host_info)s(next )?input=".*"\s*$ ^%(pid)s SMTP call from \S+ \[<HOST>\](:\d+)? (I=\[\S+\]:\d+ )?dropped: too many nonmail commands \(last was "\S+"\)\s*$ \[<HOST>\]: 535 Incorrect authentication data ^%(pid)s %(host_info)s Warning: smtp used a hostname$ ^%(pid)s no MAIL in SMTP connection from (\([^)]+\) )?\[<HOST>\] D=\d+(m\d+)?s( C=.*)?$ ^%(pid)s SMTP protocol synchronization error \(input sent without waiting for greeting\): rejected connection from %(host_info)s ignoreregex =