纯手工打造每一篇开源资讯与技术干货,数十万程序员和Linuxer已经关注。
导读
闲来无事,登陆服务器,发现有个IP不断的猜测路径、试图往服务器上传文件(木马)。
于是查看了之前的日志,无奈鄙站被攻击者盯上了,不断的有不同的IP试图上传木马。看来坏人还是有的。由于不想让鄙站沦为肉鸡,所以就想写个简单的脚本,来阻止攻击者的IP访问。
攻击者:
195.154.216.165 - - [28/Nov/2015:23:10:40 +0800] "POST /wp-content/themes/twentyten/404.php HTTP/1.1" 404 27 " HTTP/1.1" 404 564 "https://www.z-dig.com/11m.php" "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1)" "-"195.154.216.165 - - [28/Nov/2015:23:10:41 +0800] "POST /yanyu/?q={${eval%28$_POST[u]%29}} HTTP/1.1" 404 1569 "https://www.z-dig.com/11m.php" "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1)" "-"195.154.216.165 - - [28/Nov/2015:23:10:42 +0800] "POST /ztxxw/Images/images.asp HTTP/1.1" 404 1569 "https://www.z-dig.com/11m.php" "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1)" "-"