[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: failtoban



Vincent Gay a écrit :
> Fabrice Chaillou a écrit :

>> 
>> Autre chose, j'ai été moi aussi surpris du fonctionnement au
>> début.... Jusqu'à ce que je comprenne que fail2ban analyse les logs
>> à intervalle régulier et bannit les IP à ce moment là. Le
>> bannissement n'est donc pas immédiat !
> 
> Ahhh ! je ne vois pas l'intérêt de bannir 2 heures après une
> tentative d'attaque par force brute.

C'est une bonne question... que je continue à me poser.
Une esquisse de réponse : en regardant mes logs, je vois qu'il y a 3 à 4
secondes entre chaque tentative de connexion. Donc une analyse du log
toutes les 30s [1] détectera l'attaque au plus tard à la 10e tentative,
ce qui est raisonnable si ton système est un poil sécure (genre
n'autoriser ssh qu'à certains utlilisateurs...).

Et, d'expérience, c'est ce qui se passe [2].


F.


[1] C'est le réglage par défaut pour denyhosts (c'est ce que j'utilise,
ça a l'air de marcher pareil, en plus frustre peut-être).

[2] Deux exemples d'IP bannies :
fabrice@houlala:~$ grep 202.141.41.155 /var/log/auth.log
Jun  4 21:17:43 localhost sshd[8266]: Did not receive identification
string from 202.141.41.155
Jun  4 21:21:23 localhost sshd[8377]: Invalid user admin from 202.141.41.155
Jun  4 21:21:26 localhost sshd[8381]: Invalid user admin from 202.141.41.155
Jun  4 21:21:29 localhost sshd[8385]: Invalid user admin from 202.141.41.155
Jun  4 21:21:31 localhost sshd[8387]: Invalid user administrator from
202.141.41.155
Jun  4 21:21:34 localhost sshd[8391]: Invalid user jack from 202.141.41.155
Jun  4 21:21:37 localhost sshd[8393]: Invalid user marvin from
202.141.41.155
Jun  4 21:21:39 localhost sshd[8397]: Invalid user andres from
202.141.41.155
Jun  4 21:21:42 localhost sshd[8399]: Invalid user barbara from
202.141.41.155
Jun  4 21:21:44 localhost sshd[8403]: Invalid user adine from 202.141.41.155
Jun  4 21:21:47 localhost sshd[8405]: Invalid user test from 202.141.41.155
Jun  4 21:21:49 localhost sshd[8409]: Invalid user guest from 202.141.41.155
Jun  4 21:21:51 localhost sshd[8411]: Invalid user db from 202.141.41.155
Jun  4 21:21:54 localhost sshd[8415]: Invalid user ahmed from 202.141.41.155
Jun  4 21:21:57 localhost sshd[8417]: Invalid user alan from 202.141.41.155
Jun  4 21:21:58 localhost sshd[8421]: refused connect from
::ffff:202.141.41.155 (::ffff:202.141.41.155)

fabrice@houlala:~$ grep 59.81.126.147 /var/log/auth.log
Jun  4 23:01:27 localhost sshd[11686]: Did not receive identification
string from 59.81.126.147
Jun  4 23:05:41 localhost sshd[11799]: Invalid user admin from 59.81.126.147
Jun  4 23:05:45 localhost sshd[11801]: Invalid user test from 59.81.126.147
Jun  4 23:05:49 localhost sshd[11805]: Invalid user guest from 59.81.126.147
Jun  4 23:05:52 localhost sshd[11809]: Invalid user webmaster from
59.81.126.147Jun  4 23:05:59 localhost sshd[11815]: Invalid user oracle
from 59.81.126.147
Jun  4 23:06:03 localhost sshd[11819]: Invalid user library from
59.81.126.147
Jun  4 23:06:07 localhost sshd[11828]: refused connect from
::ffff:59.81.126.147 (::ffff:59.81.126.147)
fabrice@houlala:~$



Reply to: