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/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 \ |
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
#!/usr/bin/env bash | |
# Evan Wilde <[email protected]> | |
# July 20, 2017 | |
# defaults | |
user="postgres" | |
passwd="" | |
host="localhost" | |
db="ghtorrent" | |
tmpdir='/tmp' |
OlderNewer