logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 07-10-2018 10:34:44

Auden
Membre
Inscription : 26-06-2011

Regex dans fail2ban

Bonjour,

Je suis entrain de mettre en place un filtre pour éviter que les gens se balladent sur mon serveur en tapant n'importe quoi dans mes url.
Actuellement dans mes logs /var/log/apache2/error.log  j'ai des :

[Sun Oct 07 05:45:57.329190 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/java.php' not found or unable to stat
[Sun Oct 07 05:45:57.599794 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/_query.php' not found or unable to stat
[Sun Oct 07 05:45:57.870781 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/test.php' not found or unable to stat
[Sun Oct 07 05:45:58.141191 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/db_cts.php' not found or unable to stat
[Sun Oct 07 05:45:58.412226 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/db_pma.php' not found or unable to stat
[Sun Oct 07 05:45:58.682533 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/logon.php' not found or unable to stat
[Sun Oct 07 05:45:58.954450 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/help-e.php' not found or unable to stat
[Sun Oct 07 05:45:59.225778 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/license.php' not found or unable to stat
[Sun Oct 07 05:45:59.496204 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/log.php' not found or unable to stat
[Sun Oct 07 05:45:59.766696 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/hell.php' not found or unable to stat
[Sun Oct 07 05:46:00.043624 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/pmd_online.php' not found or unable to stat
[Sun Oct 07 05:46:00.839209 2018] [:error] [pid 31783] [client 113.18.204.35:18883] script '/var/www/x.php' not found or unable to stat



J'ai beau suivre un paquet de tuto et de regex pour filtrer ces lignes, pas moyen de les intercepter.

Si vous avez la bonne syntaxe je suis preneur, j'avoue, j'ai vraiment du mal avec les expressions régulières !!

Merci

Hors ligne

#2 07-10-2018 18:01:31

Auden
Membre
Inscription : 26-06-2011

Re : Regex dans fail2ban

Bonsoir,

Même avec cette regex je n'arrive rien à matcher...

^<HOST>(.*)$



Je devrais tout matcher là non ?

Hors ligne

Pied de page des forums