Skip to content

Instantly share code, notes, and snippets.

@absturztaube
Last active October 25, 2017 14:45
Show Gist options
  • Save absturztaube/75edec19a7b7a184dcf377012d7c3626 to your computer and use it in GitHub Desktop.
Save absturztaube/75edec19a7b7a184dcf377012d7c3626 to your computer and use it in GitHub Desktop.
Gets a list of ips with number of failed login attempt on sshd
grep "$(date +"%b %d")" /var/log/auth.log | grep sshd | grep -i "failed password" | sed -r "s/.*\s(([0-9]+\.){3}[0-9]+)\s.*/\1/g" | sort | uniq -c | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment