fail2ban-regex combina com strings, mas não com arquivos log e conf, por quê?

2

Se eu correr

fail2ban-regex '31.22.105.115 - - [11/Apr/2014:18:09:54 +0100] "GET /admin/config.php 
HTTP/1.0" 301 573 "-" "-"' '^<HOST> - - (?:\[[^]]*\] )+\"(GET|POST)/(?i)(PMA|phptest|phpmyadmin|myadmin|mysql|mysqladmin|sqladmin|mypma|admin|xampp|mysqldb|mydb|db|pmadb|phpmyadmin1|phpmyadmin2|cgi-bin)'

Então eu recebo Success, the total number of match is 1 . Ainda se eu tiver um access.log contendo

 .
 .
109.68.191.26 - - [11/Apr/2014:12:47:50 +0100] "GET / HTTP/1.0" 301 541 "-" "masscan/1.0 (https://github.com/robertdavidgraham/masscan)"
31.22.105.115 - - [11/Apr/2014:18:09:54 +0100] "GET /admin/config.php HTTP/1.0" 301 573 "-" "-"

e um arquivo filter.d .conf contendo

failregex  = '^<HOST> - - (?:\[[^]]*\] )+\"(GET|POST) /(?i)(PMA|phptest|phpmyadmin|myadmin|mysql|mysqladmin|sqladmin|mypma|admin|xampp|mysqldb|mydb|db|pmadb|phpmyadmin1|phpmyadmin2|cgi-bin)'

, e eu tento executar fail2ban-regex path/to/access.log /etc/fail2ban/filter.d/apache-getphp.conf Eu recebo Sorry, no match , por quê?

    
por fpghost 11.04.2014 / 22:28

1 resposta

2

Ah, simplesmente que eu não deveria citar o regex no arquivo filter.d, ou seja, deveria ser:

failregex  = ^<HOST> - - (?:\[[^]]*\] )+\"(GET|POST) /(?i)(PMA|phptest|phpmyadmin|myadmin|mysql|mysqladmin|sqladmin|mypma|admin|xampp|mysqldb|mydb|db|pmadb|phpmyadmin1|phpmyadmin2|cgi-bin)
    
por 11.04.2014 / 23:26