Amazon EC2 实例收到不同 PHP 文件名的垃圾邮件

WKF*_*KFY 5 php amazon-ec2 amazon-web-services apache-2.4

我们的服务器最近受到攻击,在日志中看起来类似于以下内容:

[Mon Feb 18 09:18:43 2019] [IP_ADDRESS] script '/var/www/ynm.php' not found or unable to stat
[Mon Feb 18 09:18:43 2019] [IP_ADDRESS] script '/var/www/71.php' not found or unable to stat
[Mon Feb 18 09:18:44 2019] [IP_ADDRESS] script '/var/www/wadre.php' not found or unable to stat
[Mon Feb 18 09:18:44 2019] [IP_ADDRESS] script '/var/www/vm.php' not found or unable to stat
[Mon Feb 18 09:18:44 2019] [IP_ADDRESS] script '/var/www/test.php' not found or unable to stat
[Mon Feb 18 09:18:44 2019] [IP_ADDRESS] script '/var/www/1q.php' not found or unable to stat
[Mon Feb 18 09:18:45 2019] [IP_ADDRESS] script '/var/www/1111.php' not found or unable to stat
[Mon Feb 18 09:18:45 2019] [IP_ADDRESS] script '/var/www/errors.php' not found or unable to stat
[Mon Feb 18 09:18:46 2019] [IP_ADDRESS] script '/var/www/q.php' not found or unable to stat
Run Code Online (Sandbox Code Playgroud)

这些攻击有时会持续数小时并冻结服务器。

如何防范这种情况?失败2ban?

已手动禁止 IP,但每次都会更改。

谢谢!

MLu*_*MLu 4

这些都是常见现象。机器人试图找到不安全的脚本并利用它们。你无法真正避免它,一旦你在互联网上有了网络服务器,你就会看到这样的扫描。

然而,由于您在 AWS EC2 上运行,因此您有多种选择:

  1. 使用AWS WAF(Web 应用程序防火墙)保护您的网站免受恶意攻击。

  2. 使用AWS Shield - 托管 DDoS 防护。自由的。

  3. ETC...

无论如何,像这样的扫描不应该冻结您的服务器。这种冻结可能是由其他原因引起的 - 可能是 DDoS(提示:使用AWS Shield)或对消耗实例内存的 PHP 脚本之一的成功利用。

希望有帮助:)