Created
May 10, 2025 19:51
-
-
Save robertsinfosec/be19323d52b2e1d13187ec94685f3767 to your computer and use it in GitHub Desktop.
Shows details of all active Fail2Ban jails on the current system.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
JAILS=$(fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g') | |
INDEX=1 | |
for JAIL in $JAILS | |
do | |
echo "" | |
echo -n "${INDEX}) " | |
fail2ban-client status $JAIL | |
((INDEX++)) | |
done | |
echo "" | |
echo "$(find /var/log/syslog -type f -mtime -1 -exec grep "UFW BLOCK" {} \; | wc -l) blocks in the past 24 hours." | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment