因为收到 CloudWatch 通知我主机 CPU 使用率超过 80%,上去一看发现有人正在尝试暴力登入。
54.182.204.56 - - [08/Nov/2016:10:16:21 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:21 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:21 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:22 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:22 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:22 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:22 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:22 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:23 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:23 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
54.182.204.56 - - [08/Nov/2016:10:16:23 +0800] "POST /wp-login.php HTTP/1.1" 200 3656 "-" "Amazon CloudFront"
只取其中一段,因为其他都是一样的。
目前用 iptables
把该 IP 挡掉了,Nginx 的 access.log 立即停止出现登入尝试:
$ sudo iptables -A INPUT -s 54.182.204.56 -j DROP
以上两个问题请教贤达,先谢谢各位!