Last active
August 29, 2015 14:10
-
-
Save ivan-kleshnin/6fd48873eba25f2c3ac5 to your computer and use it in GitHub Desktop.
How to reveal hackers and spammers in standard nginx logs (OS X instruction)
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
# put this file in home folder | |
date_format %d/%b/%Y | |
log_format %h %^[%d:%^] "%r" %s %b "%R" "%u" |
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
1) brew install goaccess | |
2) cd to logs folder | |
3) gunzip -c nginx.* | goaccess -p ~/.goaccessrc # does not work without explicit path to config (bug!) | |
select [5-hosts], enter and see most active hosts (bots, scanners, etc.) | |
4) gunzip -c nginx.access* | awk '($9 ~ /404/)' | cut -d " " -f 1,6,7,8 | uniq | less | |
see and analyze 404 errors manually |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment