Apache Webserver Prevent Bot Access / 아파치 웹서버에 봇 접근 방지 처리

웹서버를 운영하며 액세스 로그를 확인해보면 의외로 많은 봇들의 접속에 놀랄 수 있습니다.

If you check access logs while maintenance web sever, you may be surprised by connections of many bots.

 

정말 많은 봇들이 있고 많은 정보를 가져가려 많은 액세스를 시도하죠.  그런데 이들이 정상적인 정보만 크롤링하여 검색엔진 등에 노출시켜주는 유익한 일만을 하게될지는 장담할 수 없는 일입니다. 또한 불필요하게 많은 액세스로그, 에러로그가 발생하여 트래픽과 로그파일의 용량이 금방 커지는 문제가 발생하게 됩니다.

They try to many access to get some informations. However no one knows whether they will only collect normal information and use it normally. In addition, unnecessarily many accesses and indiscriminate access will cause the size problem of access log and error log.

 

SemrushBot 의 경우 robot.txt  설정도 안통하고 많은 트래픽을 유발하기로 유명한 악성봇이죠..

AhrefsBot 도 만만치 않습니다.

 

제 웹서버 환경은 AWS EC2, apache, php7 입니다.

/etc/httpd/conf.d 폴더에 bad-bot.conf 라는 설정파일을 하나 생성하여 아래의 내용을 넣습니다.

conf.d 폴더에 넣은 설정파일(*.conf)들은 아파치서버가 구동되어 httpd.conf 파일이 참조될 때 모두 불러들입니다.

 

<Directory “/var/www/*”> ## 보유한 서버의 환경에 맞게 설정할 것

# SetEnvIfNoCase User-Agent ^$ bad-bot
SetEnvIfNoCase User-Agent “^MJ12bot” bad-bot
SetEnvIfNoCase User-Agent “^MJ12bot/v1.4.5” bad-bot

#악성봇…
SetEnvIfNoCase User-Agent “SemrushBot” bad-bot #181203
SetEnvIfNoCase User-Agent “SemrushBot-SA” bad-bot #181203
SetEnvIfNoCase User-Agent “DomainCrawler” bad-bot #181210
SetEnvIfNoCase User-Agent “MegaIndex.ru” bad-bot #181215
SetEnvIfNoCase User-Agent “AlphaBot” bad-bot #181219

#기타 귀찮은 것들
SetEnvIfNoCase User-Agent “ltx71” bad-bot
SetEnvIfNoCase User-Agent “CCBot” bad-bot
SetEnvIfNoCase User-Agent “Sogou” bad-bot
SetEnvIfNoCase User-Agent “DotBot” bad-bot
SetEnvIfNoCase User-Agent “PiplBot” bad-bot
SetEnvIfNoCase User-Agent “MJ12bot” bad-bot
SetEnvIfNoCase User-Agent “AhrefsBot” bad-bot
SetEnvIfNoCase User-Agent “MauiBot” bad-bot
SetEnvIfNoCase User-Agent “AhrefsBot” bad-bot
SetEnvIfNoCase User-Agent “ezooms” bad-bot
SetEnvIfNoCase User-Agent “sistrix” bad-bot
SetEnvIfNoCase User-Agent “Yandex” bad-bot

# Block Bad Bots & Scrapers
SetEnvIfNoCase User-Agent “Aboundex” bad-bot
SetEnvIfNoCase User-Agent “80legs” bad-bot
SetEnvIfNoCase User-Agent “360Spider” bad-bot
SetEnvIfNoCase User-Agent “^Java” bad-bot
SetEnvIfNoCase User-Agent “^Cogentbot” bad-bot
SetEnvIfNoCase User-Agent “^Alexibot” bad-bot
SetEnvIfNoCase User-Agent “^asterias” bad-bot
SetEnvIfNoCase User-Agent “^attach” bad-bot
SetEnvIfNoCase User-Agent “^BackDoorBot” bad-bot
SetEnvIfNoCase User-Agent “^BackWeb” bad-bot
SetEnvIfNoCase User-Agent “Bandit” bad-bot
SetEnvIfNoCase User-Agent “^BatchFTP” bad-bot
SetEnvIfNoCase User-Agent “^Bigfoot” bad-bot
SetEnvIfNoCase User-Agent “^Black.Hole” bad-bot
SetEnvIfNoCase User-Agent “^BlackWidow” bad-bot
SetEnvIfNoCase User-Agent “^BlowFish” bad-bot
SetEnvIfNoCase User-Agent “^BotALot” bad-bot
SetEnvIfNoCase User-Agent “Buddy” bad-bot
SetEnvIfNoCase User-Agent “^BuiltBotTough” bad-bot
SetEnvIfNoCase User-Agent “^Bullseye” bad-bot
SetEnvIfNoCase User-Agent “^BunnySlippers” bad-bot
SetEnvIfNoCase User-Agent “^Cegbfeieh” bad-bot
SetEnvIfNoCase User-Agent “^CheeseBot” bad-bot
SetEnvIfNoCase User-Agent “^CherryPicker” bad-bot
SetEnvIfNoCase User-Agent “^ChinaClaw” bad-bot
SetEnvIfNoCase User-Agent “Collector” bad-bot
SetEnvIfNoCase User-Agent “Copier” bad-bot
SetEnvIfNoCase User-Agent “^CopyRightCheck” bad-bot
SetEnvIfNoCase User-Agent “^cosmos” bad-bot
SetEnvIfNoCase User-Agent “^Crescent” bad-bot
SetEnvIfNoCase User-Agent “^Custo” bad-bot
SetEnvIfNoCase User-Agent “^AIBOT” bad-bot
SetEnvIfNoCase User-Agent “^DISCo” bad-bot
SetEnvIfNoCase User-Agent “^DIIbot” bad-bot
SetEnvIfNoCase User-Agent “^DittoSpyder” bad-bot
SetEnvIfNoCase User-Agent “^Download\ Demon” bad-bot
SetEnvIfNoCase User-Agent “^Download\ Devil” bad-bot
SetEnvIfNoCase User-Agent “^Download\ Wonder” bad-bot
SetEnvIfNoCase User-Agent “^dragonfly” bad-bot
SetEnvIfNoCase User-Agent “^Drip” bad-bot
SetEnvIfNoCase User-Agent “^eCatch” bad-bot
SetEnvIfNoCase User-Agent “^EasyDL” bad-bot
SetEnvIfNoCase User-Agent “^ebingbong” bad-bot
SetEnvIfNoCase User-Agent “^EirGrabber” bad-bot
SetEnvIfNoCase User-Agent “^EmailCollector” bad-bot
SetEnvIfNoCase User-Agent “^EmailSiphon” bad-bot
SetEnvIfNoCase User-Agent “^EmailWolf” bad-bot
SetEnvIfNoCase User-Agent “^EroCrawler” bad-bot
SetEnvIfNoCase User-Agent “^Exabot” bad-bot
SetEnvIfNoCase User-Agent “^Express\ WebPictures” bad-bot
SetEnvIfNoCase User-Agent “Extractor” bad-bot
SetEnvIfNoCase User-Agent “^EyeNetIE” bad-bot
SetEnvIfNoCase User-Agent “^Foobot” bad-bot
SetEnvIfNoCase User-Agent “^flunky” bad-bot
SetEnvIfNoCase User-Agent “^FrontPage” bad-bot
SetEnvIfNoCase User-Agent “^Go-Ahead-Got-It” bad-bot
SetEnvIfNoCase User-Agent “^gotit” bad-bot
SetEnvIfNoCase User-Agent “^GrabNet” bad-bot
SetEnvIfNoCase User-Agent “^Grafula” bad-bot
SetEnvIfNoCase User-Agent “^Harvest” bad-bot
SetEnvIfNoCase User-Agent “^hloader” bad-bot
SetEnvIfNoCase User-Agent “^HMView” bad-bot
SetEnvIfNoCase User-Agent “^HTTrack” bad-bot
SetEnvIfNoCase User-Agent “^humanlinks” bad-bot
SetEnvIfNoCase User-Agent “^IlseBot” bad-bot
SetEnvIfNoCase User-Agent “^Image\ Stripper” bad-bot
SetEnvIfNoCase User-Agent “^Image\ Sucker” bad-bot
SetEnvIfNoCase User-Agent “Indy\ Library” bad-bot
SetEnvIfNoCase User-Agent “^InfoNaviRobot” bad-bot
SetEnvIfNoCase User-Agent “^InfoTekies” bad-bot
SetEnvIfNoCase User-Agent “^Intelliseek” bad-bot
SetEnvIfNoCase User-Agent “^InterGET” bad-bot
SetEnvIfNoCase User-Agent “^Internet\ Ninja” bad-bot
SetEnvIfNoCase User-Agent “^Iria” bad-bot
SetEnvIfNoCase User-Agent “^Jakarta” bad-bot
SetEnvIfNoCase User-Agent “^JennyBot” bad-bot
SetEnvIfNoCase User-Agent “^JetCar” bad-bot
SetEnvIfNoCase User-Agent “^JOC” bad-bot
SetEnvIfNoCase User-Agent “^JustView” bad-bot
SetEnvIfNoCase User-Agent “^Jyxobot” bad-bot
SetEnvIfNoCase User-Agent “^Kenjin.Spider” bad-bot
SetEnvIfNoCase User-Agent “^Keyword.Density” bad-bot
SetEnvIfNoCase User-Agent “^larbin” bad-bot
SetEnvIfNoCase User-Agent “^LexiBot” bad-bot
SetEnvIfNoCase User-Agent “^lftp” bad-bot
SetEnvIfNoCase User-Agent “^libWeb/clsHTTP” bad-bot
SetEnvIfNoCase User-Agent “^likse” bad-bot
SetEnvIfNoCase User-Agent “^LinkextractorPro” bad-bot
SetEnvIfNoCase User-Agent “^LinkScan/8.1a.Unix” bad-bot
SetEnvIfNoCase User-Agent “^LNSpiderguy” bad-bot
SetEnvIfNoCase User-Agent “^LinkWalker” bad-bot
SetEnvIfNoCase User-Agent “^lwp-trivial” bad-bot
SetEnvIfNoCase User-Agent “^LWP::Simple” bad-bot
SetEnvIfNoCase User-Agent “^Magnet” bad-bot
SetEnvIfNoCase User-Agent “^Mag-Net” bad-bot
SetEnvIfNoCase User-Agent “^MarkWatch” bad-bot
SetEnvIfNoCase User-Agent “^Mass\ Downloader” bad-bot
SetEnvIfNoCase User-Agent “^Mata.Hari” bad-bot
SetEnvIfNoCase User-Agent “^Memo” bad-bot
SetEnvIfNoCase User-Agent “^Microsoft.URL” bad-bot
SetEnvIfNoCase User-Agent “^Microsoft\ URL\ Control” bad-bot
SetEnvIfNoCase User-Agent “^MIDown\ tool” bad-bot
SetEnvIfNoCase User-Agent “^MIIxpc” bad-bot
SetEnvIfNoCase User-Agent “^Mirror” bad-bot
SetEnvIfNoCase User-Agent “^Missigua\ Locator” bad-bot
SetEnvIfNoCase User-Agent “^Mister\ PiX” bad-bot
SetEnvIfNoCase User-Agent “^moget” bad-bot
SetEnvIfNoCase User-Agent “^Mozilla/3.Mozilla/2.01” bad-bot
SetEnvIfNoCase User-Agent “^Mozilla.*NEWT” bad-bot
SetEnvIfNoCase User-Agent “^NAMEPROTECT” bad-bot
SetEnvIfNoCase User-Agent “^Navroad” bad-bot
SetEnvIfNoCase User-Agent “^NearSite” bad-bot
SetEnvIfNoCase User-Agent “^NetAnts” bad-bot
SetEnvIfNoCase User-Agent “^Netcraft” bad-bot
SetEnvIfNoCase User-Agent “^NetMechanic” bad-bot
SetEnvIfNoCase User-Agent “^NetSpider” bad-bot
SetEnvIfNoCase User-Agent “^Net\ Vampire” bad-bot
SetEnvIfNoCase User-Agent “^NetZIP” bad-bot
SetEnvIfNoCase User-Agent “^NextGenSearchBot” bad-bot
SetEnvIfNoCase User-Agent “^NG” bad-bot
SetEnvIfNoCase User-Agent “^NICErsPRO” bad-bot
SetEnvIfNoCase User-Agent “^niki-bot” bad-bot
SetEnvIfNoCase User-Agent “^NimbleCrawler” bad-bot
SetEnvIfNoCase User-Agent “^Ninja” bad-bot
SetEnvIfNoCase User-Agent “^NPbot” bad-bot
SetEnvIfNoCase User-Agent “^Octopus” bad-bot
SetEnvIfNoCase User-Agent “^Offline\ Explorer” bad-bot
SetEnvIfNoCase User-Agent “^Offline\ Navigator” bad-bot
SetEnvIfNoCase User-Agent “^Openfind” bad-bot
SetEnvIfNoCase User-Agent “^OutfoxBot” bad-bot
SetEnvIfNoCase User-Agent “^PageGrabber” bad-bot
SetEnvIfNoCase User-Agent “^Papa\ Foto” bad-bot
SetEnvIfNoCase User-Agent “^pavuk” bad-bot
SetEnvIfNoCase User-Agent “^pcBrowser” bad-bot
SetEnvIfNoCase User-Agent “^PHP\ version\ tracker” bad-bot
SetEnvIfNoCase User-Agent “^Pockey” bad-bot
SetEnvIfNoCase User-Agent “^ProPowerBot/2.14” bad-bot
SetEnvIfNoCase User-Agent “^ProWebWalker” bad-bot
SetEnvIfNoCase User-Agent “^psbot” bad-bot
SetEnvIfNoCase User-Agent “^Pump” bad-bot
SetEnvIfNoCase User-Agent “^QueryN.Metasearch” bad-bot
SetEnvIfNoCase User-Agent “^RealDownload” bad-bot
SetEnvIfNoCase User-Agent “Reaper” bad-bot
SetEnvIfNoCase User-Agent “Recorder” bad-bot
SetEnvIfNoCase User-Agent “^ReGet” bad-bot
SetEnvIfNoCase User-Agent “^RepoMonkey” bad-bot
SetEnvIfNoCase User-Agent “^RMA” bad-bot
SetEnvIfNoCase User-Agent “Siphon” bad-bot
SetEnvIfNoCase User-Agent “^SiteSnagger” bad-bot
SetEnvIfNoCase User-Agent “^SlySearch” bad-bot
SetEnvIfNoCase User-Agent “^SmartDownload” bad-bot
SetEnvIfNoCase User-Agent “^Snake” bad-bot
SetEnvIfNoCase User-Agent “^Snapbot” bad-bot
SetEnvIfNoCase User-Agent “^Snoopy” bad-bot
SetEnvIfNoCase User-Agent “^sogou” bad-bot
SetEnvIfNoCase User-Agent “^SpaceBison” bad-bot
SetEnvIfNoCase User-Agent “^SpankBot” bad-bot
SetEnvIfNoCase User-Agent “^spanner” bad-bot
SetEnvIfNoCase User-Agent “^Sqworm” bad-bot
SetEnvIfNoCase User-Agent “Stripper” bad-bot
SetEnvIfNoCase User-Agent “Sucker” bad-bot
SetEnvIfNoCase User-Agent “^SuperBot” bad-bot
SetEnvIfNoCase User-Agent “^SuperHTTP” bad-bot
SetEnvIfNoCase User-Agent “^Surfbot” bad-bot
SetEnvIfNoCase User-Agent “^suzuran” bad-bot
SetEnvIfNoCase User-Agent “^Szukacz/1.4” bad-bot
SetEnvIfNoCase User-Agent “^tAkeOut” bad-bot
SetEnvIfNoCase User-Agent “^Teleport” bad-bot
SetEnvIfNoCase User-Agent “^Telesoft” bad-bot
SetEnvIfNoCase User-Agent “^TurnitinBot/1.5” bad-bot
SetEnvIfNoCase User-Agent “^The.Intraformant” bad-bot
SetEnvIfNoCase User-Agent “^TheNomad” bad-bot
SetEnvIfNoCase User-Agent “^TightTwatBot” bad-bot
SetEnvIfNoCase User-Agent “^Titan” bad-bot
SetEnvIfNoCase User-Agent “^True_Robot” bad-bot
SetEnvIfNoCase User-Agent “^turingos” bad-bot
SetEnvIfNoCase User-Agent “^TurnitinBot” bad-bot
SetEnvIfNoCase User-Agent “^URLy.Warning” bad-bot
SetEnvIfNoCase User-Agent “^Vacuum” bad-bot
SetEnvIfNoCase User-Agent “^VCI” bad-bot
SetEnvIfNoCase User-Agent “^VoidEYE” bad-bot
SetEnvIfNoCase User-Agent “^Web\ Image\ Collector” bad-bot
SetEnvIfNoCase User-Agent “^Web\ Sucker” bad-bot
SetEnvIfNoCase User-Agent “^WebAuto” bad-bot
SetEnvIfNoCase User-Agent “^WebBandit” bad-bot
SetEnvIfNoCase User-Agent “^Webclipping.com” bad-bot
SetEnvIfNoCase User-Agent “^WebCopier” bad-bot
SetEnvIfNoCase User-Agent “^WebEMailExtrac.*” bad-bot
SetEnvIfNoCase User-Agent “^WebEnhancer” bad-bot
SetEnvIfNoCase User-Agent “^WebFetch” bad-bot
SetEnvIfNoCase User-Agent “^WebGo\ IS” bad-bot
SetEnvIfNoCase User-Agent “^Web.Image.Collector” bad-bot
SetEnvIfNoCase User-Agent “^WebLeacher” bad-bot
SetEnvIfNoCase User-Agent “^WebmasterWorldForumBot” bad-bot
SetEnvIfNoCase User-Agent “^WebReaper” bad-bot
SetEnvIfNoCase User-Agent “^WebSauger” bad-bot
SetEnvIfNoCase User-Agent “^Website\ eXtractor” bad-bot
SetEnvIfNoCase User-Agent “^Website\ Quester” bad-bot
SetEnvIfNoCase User-Agent “^Webster” bad-bot
SetEnvIfNoCase User-Agent “^WebStripper” bad-bot
SetEnvIfNoCase User-Agent “^WebWhacker” bad-bot
SetEnvIfNoCase User-Agent “^WebZIP” bad-bot
SetEnvIfNoCase User-Agent “Whacker” bad-bot
SetEnvIfNoCase User-Agent “^Widow” bad-bot
SetEnvIfNoCase User-Agent “^WISENutbot” bad-bot
SetEnvIfNoCase User-Agent “^WWWOFFLE” bad-bot
SetEnvIfNoCase User-Agent “^WWW-Collector-E” bad-bot
SetEnvIfNoCase User-Agent “^Xaldon” bad-bot
SetEnvIfNoCase User-Agent “^Xenu” bad-bot
SetEnvIfNoCase User-Agent “^Zeus” bad-bot
SetEnvIfNoCase User-Agent “ZmEu” bad-bot
SetEnvIfNoCase User-Agent “^Zyborg” bad-bot

# Vulnerability Scanners
SetEnvIfNoCase User-Agent “Acunetix” bad-bot
SetEnvIfNoCase User-Agent “FHscan” bad-bot

# Aggressive Chinese Search Engine
SetEnvIfNoCase User-Agent “Baiduspider” bad-bot

<RequireAny>
<RequireAll>
Require all granted
Require not env bad-bot
</RequireAll>
</RequireAny>

</Directory>

 

 

 

 

[참조]

https://xetown.com/tips/1130812

https://www.wsgvet.com/bbs/board.php?bo_table=home&wr_id=472

https://www.the-art-of-web.com/system/apache-authorization/