doc:appunti:linux:sa:fail2ban
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:linux:sa:fail2ban [2020/10/30 15:15] – [Reference configurazione predefinita] niccolo | doc:appunti:linux:sa:fail2ban [2022/07/21 11:22] – [Integrazione con Shorewall] niccolo | ||
---|---|---|---|
Line 148: | Line 148: | ||
^ banaction | ^ banaction | ||
^ banaction_allports | ^ banaction_allports | ||
- | ^ actionban | + | ^ actionban |
- | ^ actionunban | + | ^ actionunban |
===== Integrazione con Shorewall ===== | ===== Integrazione con Shorewall ===== | ||
Line 160: | Line 160: | ||
banaction_allports = shorewall | banaction_allports = shorewall | ||
</ | </ | ||
+ | |||
+ | ===== Esempio per WordPress wp-login.php ===== | ||
+ | |||
+ | Un caso tipico di attacco a forza bruta è quello contro il login di WordPress, nei file di log Apache si legge: | ||
+ | |||
+ | < | ||
+ | 185.120.86.118 - - [21/ | ||
+ | 185.120.86.118 - - [21/ | ||
+ | </ | ||
+ | |||
+ | In questo caso si agisce sull' | ||
+ | |||
+ | < | ||
+ | [Definition] | ||
+ | failregex = ^< | ||
+ | ^< | ||
+ | ^< | ||
+ | ^< | ||
+ | ignoreregex = | ||
+ | </ | ||
+ | |||
+ | Come si vede si approfitta per bloccare anche gli accessi a **xmlrpc.php**, | ||
+ | |||
+ | Quindi si definisce la regola di ban creando il file **/ | ||
+ | |||
+ | < | ||
+ | [wordpress] | ||
+ | enabled = true | ||
+ | usedns = no | ||
+ | port = http,https | ||
+ | filter = wordpress-local | ||
+ | logpath = / | ||
+ | maxretry = 4 | ||
+ | findtime = 120 | ||
+ | bantime = 7200 | ||
+ | </ | ||
+ | |||
+ | Dopo aver fatto il reload del servizio fail2ban, chi accede a '' | ||
doc/appunti/linux/sa/fail2ban.txt · Last modified: 2023/10/30 10:32 by niccolo