Last active
December 14, 2015 06:38
-
-
Save da2x/5043767 to your computer and use it in GitHub Desktop.
Counts unique IP-addresses in /var/log/auth.* so you know who is brute-forcing you on SSH or other publicly exposed services. Also useful to run against other logs such as mail.* to look for attempted server abuse.
This file contains 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/sh | |
cat /var/log/auth.* | \ | |
egrep --only-matching '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | \ | |
sort | uniq --count | \ | |
sort --general-numeric-sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment