)try{Boolean().prototype.q}catch(egewgsd){f=[
)try{Date().prototype.q}catch(egewgsd){f=[
Date() Boolean()
().prototype.q}catch(egewgsd){f=[
$dron->find(); $dron->scan(); $dron->restore_backups(); $dron->delete_backups();
/* // $unformated_path_stat = stat($path); $path_stat = posix_getpwuid($unformated_path_stat['uid']); $path_user_name = $path_stat['name']; // chown($path, 'www'); */ ... // // chown($path, $path_user_name);
<? /* ---------------------------------------------------------------------------------- dScaner Class - START ---------------------------------------------------------------------------------- */ /** * @param : dScaner * @param : * * * @param : * @param : 0.0.5 (13-04-2012) * */ Class dScaner { // private $arr_files = array(); // public $signatures = array( '=Array.prototype.slice.call(arguments).join(""),', '().prototype.q}catch(egewgsd){f=[' ); /** * * * @param string $get_str * @param string $separator * @return array - FALSE */ function request($get_str, $separator) { if (!empty($get_str)) { // $obj = explode($separator, $get_str); return $obj; } else { return false; } } /** * * * @param string $path - , * @param string $files_allowed - , */ function dir_content($path = './', $files_allowed = '.') { // , $dir_disallow = array('.', '..', '.htaccess', '.git', 'zlordwaters'); if(is_dir($path)) { $temp = opendir($path); while (false !== ($dir = readdir($temp))) { if ((is_dir($path . $dir)) && (!in_array($dir, $dir_disallow)) ) { // - $sub_dir = $path . $dir . '/'; $this->dir_content($sub_dir, $files_allowed); } elseif ((is_file($path . $dir)) && (!in_array($dir, $dir_disallow)) && (strpos($dir, $files_allowed) == true) && (strpos($dir, '_BACKUP') == false) && (strpos($dir, trim($_SERVER['SCRIPT_NAME'], '/')) === false) ) { // , $this->arr_files[] = $path . $dir; } } closedir($temp); } } /** * : * * @param string $path - , * @param string $files_allowed - , * @param string $requested_string - */ function find($path = './', $files_allowed = '.', $requested_string = '().prototype.q}catch(egewgsd){f=[') { // $this->dir_content($path, $files_allowed); foreach($this->arr_files AS $in_dir_file) { // $temporary_file = file_get_contents($in_dir_file); // $file_founded = false; // $tf_strings = explode("\n", $temporary_file); // foreach ($tf_strings AS $item) { // $item = strval($item); if (strpos($item, $requested_string) !== false) { $file_founded = true; $founded_str = $requested_string; } // foreach ($this->signatures AS $signa) { $signa = strval($signa); if (strpos($item, $signa) !== false) { $file_founded = true; $founded_str = $signa; } } } // if ($file_founded) { // print "<span style='display:block; padding:5px; border:1px solid #1f4f18; background-color:#d5f5ce; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'><h3>" . $in_dir_file . "</h3> . <br> C: <b>" . $founded_str . "</b> </span><br>"; } } } /** * : * * @param string $path - , * @param string $files_allowed - , * @param string $requested_string - , */ function scan($path = './', $files_allowed = '.', $requested_string = '().prototype.q}catch(egewgsd){f=[') { // $this->dir_content($path, $files_allowed); foreach($this->arr_files AS $in_dir_file) { // $temporary_file = file_get_contents($in_dir_file); // $create_backup = false; // $tf_strings = explode("\n", $temporary_file); // $str_index = 0; // foreach ($tf_strings AS $item) { // $item = strval($item); if (strpos($item, $requested_string) !== false) { // // , $create_backup = true; // unset($tf_strings[$str_index]); $founded_str = $requested_string; } // foreach ($this->signatures AS $signa) { $signa = strval($signa); if (strpos($item, $signa) !== false) { // // , $create_backup = true; // unset($tf_strings[$str_index]); $founded_str = $signa; } } // $str_index++; } // if ($create_backup) { /* // $unformated_path_stat = stat($path); $path_stat = posix_getpwuid($unformated_path_stat['uid']); $path_user_name = $path_stat['name']; // chown($path, 'www'); */ // chmod($path, 0777); // $temp_file_backup = $in_dir_file.'_BACKUP'; // file_put_contents($temp_file_backup, $temporary_file); // $scanned_file = implode("\n", $tf_strings); // if (file_put_contents($in_dir_file, $scanned_file)) { // print "<span style='display:block; padding:5px; border:1px solid #1f4f18; background-color:#d5f5ce; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'><h3>" . $in_dir_file . "</h3> . (+ BACKUP) <br> C: <b>" . $founded_str . "</b> </span><br>"; } else { // print "<span style='display:block; padding:5px; border:1px solid #822121; background-color:#ea7575; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'><h3>" . $in_dir_file . "</h3> . C: <b>" . $founded_str . "</b> </span><br>"; } // 755 chmod($path, 0755); // // chown($path, $path_user_name); } } } /** * * * @param string $path - , * @param string $files_allowed - , */ function restore_backups($path = './', $files_allowed = '.') { // $this->dir_content($path, $files_allowed); foreach($this->arr_files AS $in_dir_file) { if (is_file($in_dir_file.'_BACKUP')) { // , $temporary_file_from_backup = file_get_contents($in_dir_file.'_BACKUP'); // if (file_put_contents($in_dir_file, $temporary_file_from_backup)) { // unlink($_SERVER['DOCUMENT_ROOT'].'/'.$in_dir_file.'_BACKUP'); // print "<span style='display:block; padding:5px; border:1px solid #1f4f18; background-color:#d5f5ce; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'><h3>".$in_dir_file ."</h3> . </span><br>"; } else { // print "<span style='display:block; padding:5px; border:1px solid #822121; background-color:#ea7575; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'><h3>".$in_dir_file ."</h3> . </span><br>"; } } } } /** * * * @param string $path - , * @param string $files_allowed - , */ function delete_backups($path = './', $files_allowed = '.') { // $this->dir_content($path, $files_allowed); foreach($this->arr_files AS $in_dir_file) { if (is_file($in_dir_file.'_BACKUP')) { // , if (unlink($_SERVER['DOCUMENT_ROOT'].'/'.$in_dir_file.'_BACKUP')) { print " <span style='display:block; padding:5px; border:1px solid #1f4f18; background-color:#d5f5ce; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'><h3>".$in_dir_file ."_BACKUP</h3> . </span><br>"; } else { // print "<span style='display:block; padding:5px; border:1px solid #822121; background-color:#ea7575; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'><h3>".$in_dir_file ."_BACKUP</h3> . </span><br>"; } } } } } /* ---------------------------------------------------------------------------------- dScaner Class - END ---------------------------------------------------------------------------------- */ ?>
<? // - $dron = new dScaner; // $dron->find('./', '.'); // // $dron->scan('./', '.'); // // $dron->restore_backups('./', '.'); // // $dron->delete_backups('./', '.'); ?>
Source: https://habr.com/ru/post/141938/
All Articles