[Sécurité] fail2ban
Fermé
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
-
28 janv. 2008 à 15:48
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 - 7 mai 2009 à 21:58
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 - 7 mai 2009 à 21:58
12 réponses
sebsauvage
Messages postés
32893
Date d'inscription
mercredi 29 août 2001
Statut
Modérateur
Dernière intervention
21 octobre 2019
15 655
28 janv. 2008 à 15:51
28 janv. 2008 à 15:51
En temps normal, c'est le serveur qui protège la machine.
Le client n'est utile que pour contacter l'état du serveur, débloquer manuellement une IP, etc.
Autrement dit: En utilisation quotidienne, on ne lance jamais le client.
Le client n'est utile que pour contacter l'état du serveur, débloquer manuellement une IP, etc.
Autrement dit: En utilisation quotidienne, on ne lance jamais le client.
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
28 janv. 2008 à 16:01
28 janv. 2008 à 16:01
Salut sebsauvage,
Arffff ! j'ai mal interprété un "passage" ...
Merci.
:-))
Arffff ! j'ai mal interprété un "passage" ...
Merci.
:-))
sebsauvage
Messages postés
32893
Date d'inscription
mercredi 29 août 2001
Statut
Modérateur
Dernière intervention
21 octobre 2019
15 655
28 janv. 2008 à 16:11
28 janv. 2008 à 16:11
De rien :-)
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
13 avril 2008 à 20:51
13 avril 2008 à 20:51
bonjour,
mon "problème" :
je ne comprenais pas pourquoi je ne recevais pas les notifications par mail sur la Mandriva !
autre élément à prendre en compte, j'utilise Postfix sur la Mandriva.
la solution :
source : http://www.fail2ban.org/...
je n'ai pas eu besoin de modifier le fichier mail-whois.local !
mon "problème" :
je ne comprenais pas pourquoi je ne recevais pas les notifications par mail sur la Mandriva !
autre élément à prendre en compte, j'utilise Postfix sur la Mandriva.
la solution :
Copiez /etc/fail2ban/action.d/mail-whois.conf vers /etc/fail2ban/action.d/mail-whois.local, modifiez ce fichier et remplacez mail par sendmail.
source : http://www.fail2ban.org/...
je n'ai pas eu besoin de modifier le fichier mail-whois.local !
[root@mandriva ~]# rpm -qa | grep sendmail [root@mandriva ~]# /etc/init.d/fail2ban restart Arrêt de fail2ban : [ÉCHEC ] Lancement de fail2ban : 2008-04-13 20:38:53,868 fail2ban.server : INFO Starting Fail2ban ERROR Could not start server. Maybe an old socket file is still present. Try to remove /tmp/fail2ban.sock. If you used fail2ban-client to start the server, adding the -x option will do it [ÉCHEC ] [root@mandriva ~]# [root@mandriva ~]# rm /tmp/fail2ban.sock rm: détruire socket `/tmp/fail2ban.sock'? y [root@mandriva ~]# /etc/init.d/fail2ban status fail2ban-server est arrêté [root@mandriva ~]# /etc/init.d/fail2ban start Lancement de fail2ban : 2008-04-13 20:40:13,762 fail2ban.server : INFO Starting Fail2ban [ OK ] [root@mandriva ~]#
[redfox@mandriva ~]$ mail Heirloom mailx version 12.2 01/07/07. Type ? for help. "/var/spool/mail/redfox": 2 messages >O 1 root@localhost.loc Sun Apr 13 20:40 25/707 [Fail2Ban] SSH: started O 2 root@localhost.loc Sun Apr 13 20:40 25/715 [Fail2Ban] Postfix: start ? ? ? At EOF ? At EOF ? q Held 2 messages in /var/spool/mail/redfox [redfox@mandriva ~]$
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
13 mai 2008 à 17:19
13 mai 2008 à 17:19
j'ai des soucis avec fail2ban. voir :
http://www.commentcamarche.net/forum/affich 6374535 mandriva sshd ne demarre plus au boot
j'ai donc réinstallé fail2ban
urpme fail2ban
urpmi fail2ban
je n'ai plus de messages d'erreur suivants :
2008-05-13 13:38:27,671 fail2ban.actions.action: ERROR rm -f <tmpfile> returned 200
2008-05-13 13:38:32,464 fail2ban.actions.action: ERROR echo -en "Hi,\n
2008-05-13 13:38:32,651 fail2ban.actions.action: ERROR touch <tmpfile> returned 200
2008-05-13 13:38:32,662 fail2ban.actions.action: ERROR echo -en "Hi,\n
2008-05-13 13:46:27,156 fail2ban.actions.action: ERROR rm -f <tmpfile> returned 200
2008-05-13 13:46:27,167 fail2ban.actions.action: ERROR echo -en "Hi,\n
2008-05-13 13:46:28,331 fail2ban.actions.action: ERROR echo -en "Hi,\n
2008-05-13 13:46:32,640 fail2ban.actions.action: ERROR touch <tmpfile> returned 200
2008-05-13 16:32:04,085 fail2ban.actions.action: ERROR rm -f <tmpfile> returned 200
2008-05-13 16:32:09,837 fail2ban.actions.action: ERROR touch <tmpfile> returned 200
2008-05-13 16:58:44,397 fail2ban.actions.action: ERROR rm -f <tmpfile> returned 200
reste à voir pourquoi mon attaquant n'a as été banni ??????
May 11 21:04:24 mandriva sshd[7212]: Invalid user admin from 88.33.202.155
May 11 21:04:36 mandriva sshd[7216]: Invalid user stud from 88.33.202.155
May 11 21:04:42 mandriva sshd[7218]: Invalid user trash from 88.33.202.155
May 11 21:04:52 mandriva sshd[7220]: Invalid user aaron from 88.33.202.155
May 11 21:04:58 mandriva sshd[7222]: Invalid user gt05 from 88.33.202.155
May 11 21:05:04 mandriva sshd[7224]: Invalid user william from 88.33.202.155
May 11 21:05:11 mandriva sshd[7226]: Invalid user stephanie from 88.33.202.155
May 11 21:05:49 mandriva sshd[7238]: Invalid user gary from 88.33.202.155
May 11 21:06:02 mandriva sshd[7243]: Invalid user guest from 88.33.202.155
May 11 21:06:08 mandriva sshd[7245]: Invalid user test from 88.33.202.155
May 11 21:06:14 mandriva sshd[7247]: Invalid user oracle from 88.33.202.155
May 11 21:09:01 mandriva sshd[7398]: Invalid user lab from 88.33.202.155
May 11 21:09:14 mandriva sshd[7413]: Invalid user oracle from 88.33.202.155
May 11 21:09:20 mandriva sshd[7415]: Invalid user svn from 88.33.202.155
May 11 21:09:26 mandriva sshd[7418]: Invalid user iraf from 88.33.202.155
May 11 21:09:33 mandriva sshd[7420]: Invalid user swsoft from 88.33.202.155
May 11 21:09:39 mandriva sshd[7422]: Invalid user production from 88.33.202.155
May 11 21:09:45 mandriva sshd[7424]: Invalid user guest from 88.33.202.155
May 11 21:09:51 mandriva sshd[7426]: Invalid user gast from 88.33.202.155
May 11 21:09:58 mandriva sshd[7428]: Invalid user gast from 88.33.202.155
May 11 21:10:04 mandriva sshd[7430]: Invalid user oliver from 88.33.202.155
May 11 21:10:10 mandriva sshd[7432]: Invalid user sirsi from 88.33.202.155
May 11 21:10:16 mandriva sshd[7434]: Invalid user nagios from 88.33.202.155
May 11 21:10:26 mandriva sshd[7436]: Invalid user nagios from 88.33.202.155
May 11 21:10:32 mandriva sshd[7438]: Invalid user nagios from 88.33.202.155
May 11 21:10:38 mandriva sshd[7440]: Invalid user nagios from 88.33.202.155
May 11 21:10:45 mandriva sshd[7443]: Invalid user backuppc from 88.33.202.155
May 11 21:10:51 mandriva sshd[7445]: Invalid user wolfgang from 88.33.202.155
May 11 21:10:57 mandriva sshd[7448]: Invalid user vmware from 88.33.202.155
May 11 21:11:03 mandriva sshd[7450]: Invalid user stats from 88.33.202.155
May 11 21:11:10 mandriva sshd[7452]: Invalid user kor from 88.33.202.155
http://www.commentcamarche.net/forum/affich 6374535 mandriva sshd ne demarre plus au boot
j'ai donc réinstallé fail2ban
urpme fail2ban
urpmi fail2ban
je n'ai plus de messages d'erreur suivants :
2008-05-13 13:38:27,671 fail2ban.actions.action: ERROR rm -f <tmpfile> returned 200
2008-05-13 13:38:32,464 fail2ban.actions.action: ERROR echo -en "Hi,\n
2008-05-13 13:38:32,651 fail2ban.actions.action: ERROR touch <tmpfile> returned 200
2008-05-13 13:38:32,662 fail2ban.actions.action: ERROR echo -en "Hi,\n
2008-05-13 13:46:27,156 fail2ban.actions.action: ERROR rm -f <tmpfile> returned 200
2008-05-13 13:46:27,167 fail2ban.actions.action: ERROR echo -en "Hi,\n
2008-05-13 13:46:28,331 fail2ban.actions.action: ERROR echo -en "Hi,\n
2008-05-13 13:46:32,640 fail2ban.actions.action: ERROR touch <tmpfile> returned 200
2008-05-13 16:32:04,085 fail2ban.actions.action: ERROR rm -f <tmpfile> returned 200
2008-05-13 16:32:09,837 fail2ban.actions.action: ERROR touch <tmpfile> returned 200
2008-05-13 16:58:44,397 fail2ban.actions.action: ERROR rm -f <tmpfile> returned 200
reste à voir pourquoi mon attaquant n'a as été banni ??????
May 11 21:04:24 mandriva sshd[7212]: Invalid user admin from 88.33.202.155
May 11 21:04:36 mandriva sshd[7216]: Invalid user stud from 88.33.202.155
May 11 21:04:42 mandriva sshd[7218]: Invalid user trash from 88.33.202.155
May 11 21:04:52 mandriva sshd[7220]: Invalid user aaron from 88.33.202.155
May 11 21:04:58 mandriva sshd[7222]: Invalid user gt05 from 88.33.202.155
May 11 21:05:04 mandriva sshd[7224]: Invalid user william from 88.33.202.155
May 11 21:05:11 mandriva sshd[7226]: Invalid user stephanie from 88.33.202.155
May 11 21:05:49 mandriva sshd[7238]: Invalid user gary from 88.33.202.155
May 11 21:06:02 mandriva sshd[7243]: Invalid user guest from 88.33.202.155
May 11 21:06:08 mandriva sshd[7245]: Invalid user test from 88.33.202.155
May 11 21:06:14 mandriva sshd[7247]: Invalid user oracle from 88.33.202.155
May 11 21:09:01 mandriva sshd[7398]: Invalid user lab from 88.33.202.155
May 11 21:09:14 mandriva sshd[7413]: Invalid user oracle from 88.33.202.155
May 11 21:09:20 mandriva sshd[7415]: Invalid user svn from 88.33.202.155
May 11 21:09:26 mandriva sshd[7418]: Invalid user iraf from 88.33.202.155
May 11 21:09:33 mandriva sshd[7420]: Invalid user swsoft from 88.33.202.155
May 11 21:09:39 mandriva sshd[7422]: Invalid user production from 88.33.202.155
May 11 21:09:45 mandriva sshd[7424]: Invalid user guest from 88.33.202.155
May 11 21:09:51 mandriva sshd[7426]: Invalid user gast from 88.33.202.155
May 11 21:09:58 mandriva sshd[7428]: Invalid user gast from 88.33.202.155
May 11 21:10:04 mandriva sshd[7430]: Invalid user oliver from 88.33.202.155
May 11 21:10:10 mandriva sshd[7432]: Invalid user sirsi from 88.33.202.155
May 11 21:10:16 mandriva sshd[7434]: Invalid user nagios from 88.33.202.155
May 11 21:10:26 mandriva sshd[7436]: Invalid user nagios from 88.33.202.155
May 11 21:10:32 mandriva sshd[7438]: Invalid user nagios from 88.33.202.155
May 11 21:10:38 mandriva sshd[7440]: Invalid user nagios from 88.33.202.155
May 11 21:10:45 mandriva sshd[7443]: Invalid user backuppc from 88.33.202.155
May 11 21:10:51 mandriva sshd[7445]: Invalid user wolfgang from 88.33.202.155
May 11 21:10:57 mandriva sshd[7448]: Invalid user vmware from 88.33.202.155
May 11 21:11:03 mandriva sshd[7450]: Invalid user stats from 88.33.202.155
May 11 21:11:10 mandriva sshd[7452]: Invalid user kor from 88.33.202.155
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
16 mai 2008 à 16:52
16 mai 2008 à 16:52
un fichier intéressant (dans Mandriva) est le fichier /var/log/btmp. Il contient une trace de toutes les connections échouées.
on peut bien sûr taper la commande suivante :
cat /var/log/btmp
......mais le fichier n'est pas très lisible.
on peut taper alors la commande suivante :
...ce qui est quand même beaucoup mieux !
on peut bien sûr taper la commande suivante :
cat /var/log/btmp
......mais le fichier n'est pas très lisible.
on peut taper alors la commande suivante :
[root@mandriva log]# lastb kor ssh:notty host155-202-stat Sun May 11 21:11 - 21:11 (00:00) stats ssh:notty host155-202-stat Sun May 11 21:11 - 21:11 (00:00) vmware ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) wolfgang ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) backuppc ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) nagios ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) nagios ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) nagios ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) nagios ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) sirsi ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) oliver ssh:notty host155-202-stat Sun May 11 21:10 - 21:10 (00:00) gast ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) gast ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) guest ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) producti ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) swsoft ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) iraf ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) svn ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) oracle ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) lab ssh:notty host155-202-stat Sun May 11 21:09 - 21:09 (00:00) oracle ssh:notty host155-202-stat Sun May 11 21:06 - 21:06 (00:00) test ssh:notty host155-202-stat Sun May 11 21:06 - 21:06 (00:00) guest ssh:notty host155-202-stat Sun May 11 21:06 - 21:06 (00:00) gary ssh:notty host155-202-stat Sun May 11 21:05 - 21:05 (00:00) stephani ssh:notty host155-202-stat Sun May 11 21:05 - 21:05 (00:00) william ssh:notty host155-202-stat Sun May 11 21:05 - 21:05 (00:00) gt05 ssh:notty host155-202-stat Sun May 11 21:04 - 21:04 (00:00) aaron ssh:notty host155-202-stat Sun May 11 21:04 - 21:04 (00:00) trash ssh:notty host155-202-stat Sun May 11 21:04 - 21:04 (00:00) stud ssh:notty host155-202-stat Sun May 11 21:04 - 21:04 (00:00) admin ssh:notty host155-202-stat Sun May 11 21:04 - 21:04 (00:00) btmp begins Sun May 11 21:04:24 2008 [root@mandriva log]# lastb
...ce qui est quand même beaucoup mieux !
Grunt
Messages postés
2773
Date d'inscription
jeudi 17 janvier 2008
Statut
Contributeur
Dernière intervention
3 avril 2009
301
16 mai 2008 à 17:29
16 mai 2008 à 17:29
Sinon, il y a "denyhost", que je trouve plus simple a installer, paramétrer et utiliser.
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
16 mai 2008 à 17:39
16 mai 2008 à 17:39
ha oui ! "denyhost" que je retrouve souvent sur les forums !
fail2ban marche bien et n'est pas compliqué à paramétrer et à utiliser !
le truc c'est que sur la mandriva, c'est parfois plus laborieux que pour sur autres distributions.
fail2ban marche bien et n'est pas compliqué à paramétrer et à utiliser !
le truc c'est que sur la mandriva, c'est parfois plus laborieux que pour sur autres distributions.
Grunt
Messages postés
2773
Date d'inscription
jeudi 17 janvier 2008
Statut
Contributeur
Dernière intervention
3 avril 2009
301
16 mai 2008 à 17:41
16 mai 2008 à 17:41
Ah.. parce qu'au vu des posts ça me paraissait laborieux, fail2ban. Mais apparemment, denyhost serait laborieux sous Mandriva aussi ^^
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
16 mai 2008 à 17:46
16 mai 2008 à 17:46
Ah.. parce qu'au vu des posts ça me paraissait laborieux, fail2ban
ça c'est parce que je ne suis pas très doué ! :-)
en fait, disons que je veux à tout prix que tout soit correctement configuré (alerte mails, etc .....), sinon l'installation basique est enfantine et se fait en 5 mns .....même sur la mandriva :-)
ça c'est parce que je ne suis pas très doué ! :-)
en fait, disons que je veux à tout prix que tout soit correctement configuré (alerte mails, etc .....), sinon l'installation basique est enfantine et se fait en 5 mns .....même sur la mandriva :-)
Grunt
Messages postés
2773
Date d'inscription
jeudi 17 janvier 2008
Statut
Contributeur
Dernière intervention
3 avril 2009
301
16 mai 2008 à 18:01
16 mai 2008 à 18:01
Ah oui, avec les alertes mails c'est peut être plus compliqué..
Quand je veux voir qui m'a attaqué je fais "tail /var/mail/mon_login" ce qui est, je te l'accorde, du paramétrage à la hache.
Quand je veux voir qui m'a attaqué je fais "tail /var/mail/mon_login" ce qui est, je te l'accorde, du paramétrage à la hache.
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
16 mai 2008 à 18:12
16 mai 2008 à 18:12
Quand je veux voir qui m'a attaqué je fais "tail /var/mail/mon_login" ce qui est, je te l'accorde, du paramétrage à la hache.
idem ! je regarde dans /var/log/mail/mail .....mais on peut trouver des traces dans d'autres fichiers.
le seul hic encore c'est que mon gars ne s'est pas fait bannir sur la mandriva ! ....et je voudrai bien savoir pourquoi ....
:-))
idem ! je regarde dans /var/log/mail/mail .....mais on peut trouver des traces dans d'autres fichiers.
le seul hic encore c'est que mon gars ne s'est pas fait bannir sur la mandriva ! ....et je voudrai bien savoir pourquoi ....
:-))
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
23 avril 2009 à 20:35
23 avril 2009 à 20:35
bonjour,
des soucis avec fail2ban sur ma debian !
de plus la règle fail2ban n'apparaît pas lors de la commande iptables -L -nv
à suivre ...
des soucis avec fail2ban sur ma debian !
debian:/var/log# /etc/init.d/fail2ban status Status of authentication failure monitor:fail2ban is running. debian:/var/log#
de plus la règle fail2ban n'apparaît pas lors de la commande iptables -L -nv
à suivre ...
bob031
Messages postés
8158
Date d'inscription
samedi 7 août 2004
Statut
Membre
Dernière intervention
1 septembre 2014
472
7 mai 2009 à 21:58
7 mai 2009 à 21:58
doc à re-lire :
Blocking a DNS DDOS using the fail2ban package
Posted by vlm on Sat 31 Jan 2009 at 14:20
http://web.archive.org/web/*/https://debian-administration.org/article/623/Blocking_a_DNS_DDOS_using_the_fail2ban_package
Blocking a DNS DDOS using the fail2ban package
Posted by vlm on Sat 31 Jan 2009 at 14:20
http://web.archive.org/web/*/https://debian-administration.org/article/623/Blocking_a_DNS_DDOS_using_the_fail2ban_package