Last active
January 27, 2017 00:11
-
-
Save etcwilde/a36256d951b0182f72d34982772c6ce9 to your computer and use it in GitHub Desktop.
Fun Shell Scripts
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 | |
# Who is trying to access your server without permission? | |
sudo journalctl -u sshd \ | |
| awk '/Failed password for/ {print $11}' \ | |
| while read address; do whois "$address" \ | |
| grep -m 1 -i "Country: " \ | |
| sed "s/[Cc]ountry:/$address/"; done \ | |
| awk '{print $2 " --> " $1}' \ | |
| uniq -c \ | |
| sort -r |
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
for ((I=0;J=--I;))do clear;for ((D=$LINES;S=++J**3%$COLUMNS,--D;))do printf "%*s. \n" $S;done;sleep 0.5;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment