Welcome, Guest. Please Login
FUG-FR logo
 
  HomeHelpSearchLogin  
 
[résolu] BruteForceBlocker (Read 4843 times)
dexinou
Full Member
***
Offline


BSD forever

Posts: 139
/home/web
Gender: male
[résolu] BruteForceBlocker
24. Sep 2007 at 11:43
 
Bonjour,
j'ai mi en place le bruteforceblocker pour le service ssh mais j'ai une question à propos de la table à charger dans pf.conf

Il faut en fait ajouter une table dans pf.conf:
Code:
table <bruteforce> persist file "/var/db/ssh-bruteforce" 


J'ai rajouter la table dans la config de PF et rechargé PF

Mais que doit contenir le fichier /var/db/ssh-bruteforce ?

Je viens de comprendre il suffit d ele lancer et il récupère les ip du site distant.

Mais comment le lancer en tant que service ?
Back to top
« Last Edit: 24. Sep 2007 at 16:13 by dexinou »  

FreeBSD
6.2-RELEASE /
Apache
1.3.41 (Unix) /
PHP
5.2.6 /
MySQL
5.0.51a
&&We'll can do great things...
WWW WWW dexinou  
IP Logged
 
fgudin
Global Moderator
*****
Offline


PouetPouetBSD roul3z

Posts: 1552
Thonon (74)
Gender: male
Re: BruteForceBlocker
Reply #1 - 24. Sep 2007 at 12:36
 
Le port n'a pas installé de script rc ? (cf. pkg_info(1))
Back to top
 
 
IP Logged
 
dexinou
Full Member
***
Offline


BSD forever

Posts: 139
/home/web
Gender: male
Re: BruteForceBlocker
Reply #2 - 24. Sep 2007 at 13:12
 
fgudin wrote on 24. Sep 2007 at 12:36:
Le port n'a pas installé de script rc ? (cf. [url=http://www.freebsd.org/cgi/man.cgi?query=pkg_info&apropos=0&sektion=0&manpath=FreeBSD+6.2-RELEASE&form
at=html]pkg_info(1)[/url])


Il installe le script rc que dans la version 1.0 mais pas dans la version 1.2.3

dans la version 1.0 il y a deux fichiers le bruteforceblocker.sh et le bruteforceblocker.pl
dans la version 1.2.3 il y a aussi deux fichiers bruteforceblocker.conf et le bruteforceblocker.pl mais pas de script de démarrage.

Mes ports sont à jour et il installe donc la version 1.2.3

Ce que je comprend pas c'est qu'il a renommer le fichier bruteforceblocker.pl en bruteforceblocker et il l'a mi dans /usr/local/sbin

Voici le fichier d'install du site:

Code:
INSTALLATION

 o) You will need to add a new table to the pf config file. You can do so
    by adding lines to the pf.conf similar to these:

 table <bruteforce> persist file "/var/db/ssh-bruteforce"
 block in log quick proto tcp from <bruteforce> to any port ssh

 o) You will also need to add new line into your /etc/syslog.conf so it
    will look like this:

 auth.info;authpriv.info		| exec /usr/local/sbin/bruteforceblocker

    - note that you should keep the original line, otherwise you will lose
	your sshd's logs - e.g. they will not be logged.

 o) You should also consider starting syslogd with -c option. 



Les deux premiers points ont été fait mais le 3ème point est un peu flou
You should also consider starting syslogd with -c option.

Il est dit que je dois démarrer le démon syslogd avec l'option -c
mais le démon syslogd est déjà démarré et il démarre avec ces options:
/usr/sbin/syslogd -l /var/run/log -l /var/named/var/run/log -s


Back to top
« Last Edit: 24. Sep 2007 at 13:20 by dexinou »  

FreeBSD
6.2-RELEASE /
Apache
1.3.41 (Unix) /
PHP
5.2.6 /
MySQL
5.0.51a
&&We'll can do great things...
WWW WWW dexinou  
IP Logged
 
dexinou
Full Member
***
Offline


BSD forever

Posts: 139
/home/web
Gender: male
Re: BruteForceBlocker
Reply #3 - 24. Sep 2007 at 14:13
 
Je viens de tester en lançant Bruteforceblocker manuelment et ça marche mais le problème c'est qu'il ne reste pas en arrière-plan, si je ferme la console, il s'arrête.
J'ai essayé en faisant un :
Code:
/usr/local/sbin/bruteforceblocker & 



et un:

Code:
/usr/bin/perl   /usr/local/sbin/bruteforceblocker & 



mais sans succès
Back to top
 

FreeBSD
6.2-RELEASE /
Apache
1.3.41 (Unix) /
PHP
5.2.6 /
MySQL
5.0.51a
&&We'll can do great things...
WWW WWW dexinou  
IP Logged
 
fgudin
Global Moderator
*****
Offline


PouetPouetBSD roul3z

Posts: 1552
Thonon (74)
Gender: male
Re: BruteForceBlocker
Reply #4 - 24. Sep 2007 at 14:18
 
Back to top
 
 
IP Logged
 
fgudin
Global Moderator
*****
Offline


PouetPouetBSD roul3z

Posts: 1552
Thonon (74)
Gender: male
Re: BruteForceBlocker
Reply #5 - 24. Sep 2007 at 14:21
 
dexinou wrote on 24. Sep 2007 at 13:12:
Il est dit que je dois démarrer le démon syslogd avec l'option -c mais le démon syslogd est déjà démarré et il démarre avec ces options:
/usr/sbin/syslogd -l /var/run/log -l /var/named/var/run/log -s

Réflexe: paramètres sur un daemon de base -> jeter un oeil à /etc/defaults/rc.conf: tu peux ajouter dans ton /etc/rc.conf:
Code:
syslogd_flags="-s -c" 

Back to top
 
 
IP Logged
 
dexinou
Full Member
***
Offline


BSD forever

Posts: 139
/home/web
Gender: male
Re: BruteForceBlocker
Reply #6 - 24. Sep 2007 at 14:49
 
fgudin wrote on 24. Sep 2007 at 14:21:
dexinou wrote on 24. Sep 2007 at 13:12:
Il est dit que je dois démarrer le démon syslogd avec l'option -c mais le démon syslogd est déjà démarré et il démarre avec ces options:
/usr/sbin/syslogd -l /var/run/log -l /var/named/var/run/log -s

Réflexe: paramètres sur un daemon de base -> jeter un oeil à /etc/defaults/rc.conf: tu peux ajouter dans ton /etc/rc.conf:
Code:
syslogd_flags="-s -c" 



C'est bon.

mais apparemment depuis la version 1.1, BFB ne démarre plus en arrière-plan.
http://danger.rulez.sk/projects/bruteforceblocker/CHANGELOG
Car il utilise syslogd avec | exec /usr/local/sbin/bruteforceblocker

mais j'ai un p"'tit problème car j'ai essayer delancer BFB en démon mais maintenant je n'arrive plus à faire un Kill <PID>

Code:
ps aux | grep bruteforceblocker
root     56871  0,0  4,0 10748 10020  p1  T    14:13     0:02,11 /usr/bin/perl /usr/local/sbin/bruteforceblocker (perl5.8.8)

kill 56871 


Et rien ne se passe.

Comment le tuer ?


Back to top
« Last Edit: 24. Sep 2007 at 14:57 by dexinou »  

FreeBSD
6.2-RELEASE /
Apache
1.3.41 (Unix) /
PHP
5.2.6 /
MySQL
5.0.51a
&&We'll can do great things...
WWW WWW dexinou  
IP Logged
 
[BSDf]Lenine
Full Member
***
Offline


I Love BSD!

Posts: 180
Quelque part dans l'univers...
Gender: male
Re: BruteForceBlocker
Reply #7 - 24. Sep 2007 at 15:06
 
Arf.. man kill option -KILL ca devrais le faire Wink
Back to top
 

Moi j'ai plein d'amis: les ports, man et google !
 
IP Logged
 
dexinou
Full Member
***
Offline


BSD forever

Posts: 139
/home/web
Gender: male
Re: BruteForceBlocker
Reply #8 - 24. Sep 2007 at 15:16
 
[BSDf]Lenine wrote on 24. Sep 2007 at 15:06:
Arf.. man kill option -KILL ca devrais le faire Wink


ça marche
THX
Back to top
 

FreeBSD
6.2-RELEASE /
Apache
1.3.41 (Unix) /
PHP
5.2.6 /
MySQL
5.0.51a
&&We'll can do great things...
WWW WWW dexinou  
IP Logged
 
dexinou
Full Member
***
Offline


BSD forever

Posts: 139
/home/web
Gender: male
Re: BruteForceBlocker
Reply #9 - 24. Sep 2007 at 16:07
 
Voilà c bon apparemment:

Code:
Sep 24 15:18:55 bsd sshd[57324]: Invalid user toto from 213.251.133.XXX
Sep 24 15:18:56 bsd BruteForceBlocker[57320]: adding b to the bruteforce table and firewall
Sep 24 15:18:56 bsd BruteForceBlocker[57320]: blacklist synchronized with project site
Sep 24 15:18:56 bsd BruteForceBlocker[57320]: 213.251.133.XXX was logged with total count of 1 failed attempts 



Mais le b de:
adding b to the bruteforce table and firewall

ça fait référence à quoi ?

Puis les autres:
Code:
Sep 24 16:12:19 bsd BruteForceBlocker[57320]: IP 88.191.28.XXX reached maximum number of failed attempts!
Sep 24 16:12:19 bsd BruteForceBlocker[57320]: blocking 88.191.28.XXX/32 in pf table bruteforce.
Sep 24 16:12:19 bsd BruteForceBlocker[57320]: sending email to root
Sep 24 16:12:19 bsd BruteForceBlocker[57320]: Reporting 88.191.28.XXX to BruteForceBlocker project site 



Et voici ce que ça affiche dans la console du petit pirate:
Code:
ssh toto@ssh.domain.com
ssh: connect to host ssh.domain.com port 22: Connection refused 



Merci pour tout   Smiley
Back to top
« Last Edit: 24. Sep 2007 at 20:26 by dexinou »  

FreeBSD
6.2-RELEASE /
Apache
1.3.41 (Unix) /
PHP
5.2.6 /
MySQL
5.0.51a
&&We'll can do great things...
WWW WWW dexinou  
IP Logged