大网数据广告活动
服务器运维问答

Amazon EC2 instance is getting spammed with different PHP filenames

· 52CE 我爱测

Our server has been attacked recently and looks something like the following in the logs: [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] scrip…

问题原文

原帖链接 · WKFY · CC BY-SA 4.0

Our server has been attacked recently and looks something like the following in the logs:

[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

These attacks go on for hours sometimes and freezes the server.

How to protect against this? fail2ban?

Have banned the IP's manually but they change every time.

Thanks!

社区高分解答

原帖链接 · MLu · CC BY-SA 4.0

These are common occurrences. Robots try to find insecure scripts and exploit them. You can't really avoid it, once you've got a web server on the Internet you'll see scans like this.

However since you're running on AWS EC2 you've got a number of options:

  1. Use AWS WAF (Web Application Firewall) to protect your site against malicious attacks.

  2. Use AWS Shield - managed DDoS protection. Free.

  3. Etc...

In any case being scanned like this shouldn't freeze your server. That freezing is likely being caused by something else - maybe a DDoS (hint: use AWS Shield) or some successful exploit of one of your PHP scripts that consumes the instance memory.

Hope that helps :)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。