Created
September 15, 2014 07:13
-
-
Save sponomarev/b43bf2a7453f427a21e9 to your computer and use it in GitHub Desktop.
Usefull commands when you are under ddos
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
# Позволяет получить общую картину: распределение уникальных IP, с которых идут запросы, кол-во запросов с одного IP и т.д. | |
tail -f /var/log/nginx/nginx.access.log | cut -d ' ' -f 1 | logtop | |
# Покажет распределение какой-либо строки по IP в логе. | |
grep "&key=" /var/log/nginx/nginx.access.log | cut -d ' ' -f 1 | sort | uniq -c | sort -n | tail -n 30 | |
# С какого ip сколько запросов | |
netstat -ntu | awk '{print $5}'| cut -d: -f1 | sort | uniq -c | sort -nr | more |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment