regex fail2ban rules

问题内容:

I am setting up Fail2ban on my server, recently got a lots bad bots is crawling my site cause my SQL server down

From my Apache2 logs

51.255.65.13 - - [10/Dec/2017:12:03:19 +0800] "GET /crew/nm0935095-gary-winick HTTP/1.0" 200 17985 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)"
51.255.65.30 - - [10/Dec/2017:12:03:31 +0800] "GET /movie/tt0498567-summer-time-machine-blues HTTP/1.0" 200 17658 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)"
217.182.132.190 - - [10/Dec/2017:12:03:36 +0800] "GET /movie/tt1705064-genji-monogatari:-sennen-no-nazo/ HTTP/1.0" 200 17344 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)"

how to create a failregex for “ahrefs.com” ?

Many Thanks

问题评论:

    
You don’t want fail2ban, you want Apache rules to deny referrers. A simple google for Apache deny referrer will surface plenty of resources on the topic.
    
Thank you, this is working temporary, but I checked the log, the bot is still working after few 500 error, it still crawling my site 🙁
– Roy 2019
10 hours ago

原文地址:

https://stackoverflow.com/questions/47746380/regex-fail2ban-rules

添加评论

友情链接:蝴蝶教程