Steal My Bitcoin CTF PoC
Posted by davikr 3 days ago
Comments
Comment by NorwegianDude 3 days ago
It used the development server in PHP, and did not even run requests with fpm or mod_php. Instead, it used the built in dev server of PHP, and just proxied requests from nginx to the php dev server.
Literally the first thing on top of the PHP docs about the dev server used here is this: "Warning This web server is designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network."
That is not something people do, and it also explains why the site was down all the time, cause the dev server is super slow, as it's not meant for this in any way shape or form. A real setup would add a few zeros to the requests per second a server could handle.
So all in all, this was very pointless, as it was nothing like real php sites. A shame, cause a realistic setup woild be more interesting and relevant to answer the question of how hard is it really to gain RCE on a normal site.
Comment by weird-eye-issue 3 days ago
Comment by nodja 3 days ago
Comment by unsnap_biceps 3 days ago
OP confirmed that the server was initially serving only an index.html. In that configuration, the vulnerable code path is never reached — it requires a .php file.
OP added php-version.php roughly 18–19 hours into the experiment (I'm not sure of the exact timing), so that period should be subtracted from the publicly displayed challenge duration.Comment by decidu0us9034 3 days ago
Comment by rockdoe 3 days ago
I'm skeptical of the value of such setups, unless it's clear it's an out of the box setup, and we already know those are totally broken.
I don't understand who these people think they are really fooling. Is this some AI denial?
Comment by gewetensleegte 2 days ago
Comment by rockdoe 1 day ago
Comment by ffaccount2 3 days ago
Comment by someothherguyy 3 days ago
many php setups sit behind nginx, caddy, or other webserver with a max body size limit.
anyone following OWASP / similar guidelines was probably okay here (for this particular PoC path), if not using apache/mod_php, i would think.
Comment by toast0 2 days ago
Behind nginx or similar isn't exactly on a public network. I don't think I'd run it that way, but I could see someone else doing it if they read the docs a certain way.
Comment by tonymet 3 days ago
At first glance, this wouldn't affect demonstration of the vuln.
Comment by bushwart 3 days ago
Apparently the wallet key wasn't on the server, like some in the original thread suspected, but perhaps not due to maliciousness after all.
Comment by gnabgib 3 days ago
Comment by zeratax 3 days ago
Comment by cluckindan 3 days ago
Comment by paaloeye 2 days ago
Comment by rockrroku 3 days ago
Comment by someothherguyy 3 days ago
many common nginx setups and hardening suggestions would make it very difficult to exploit. as well as any sort of distributed architecture that doesn't pin requests to clients.
there could be other undiscovered paths to exploit this vulnerability though. the PoC here uses the disclosed path for exploiting on patch day, minus mod_php.
Comment by dncornholio 2 days ago
echo 'PID: ' . getmypid();
Comment by stavros 3 days ago
In retrospect, I should have just given it a /goal and let it run overnight.
Comment by yreg 3 days ago
Namely that the vulnerability was not that easy to exploit, meaning that the myriads of servers that stayed unpatched during those initial days are probably not all members of botnets now. (Contrary to what the discourse might have made it seem like.)
Comment by rockdoe 3 days ago
The fact that people are still in denial over this is crazy.
Comment by tptacek 3 days ago
Comment by thaumaturgy 2 days ago
1. First I hear about it is a heads-up at 5:00 am 21st.
2. Available info then is pretty much, "omg, it's the end of the internet".
3. There are no specifics available on exploitable configurations.
4. Updates are not expected to be available for at least two more hours, so people start deciding to do the Madagascar "shut down everything" meme.
5. Cloudflare says they're seeing exploits in the wild, well, that's not great.
6. I shut down everything, including a national brand, because wtf else am I supposed to do at this point?
7. Updates become available at 0645. Fortunately, I don't run my entire infra on Docker, so I'm immediately deploying the updates to all configurations and bringing sites back online approximately in order of traffic volume.
8. Still no specifics on the exploit.
9. A million vibe-coded PoCs appear on GitHub ... and none of them work.
10. It's late morning local time on the 21st and I'm still bringing things back online, having taken the day off from my regular job.
11. Conversation starts to shift towards, "...oh, did we over-react? How exploitable is this exactly?"
12. Still no specifics available.
13. Somebody on the internet gets as fed up as I am with the whole chaos vortex of idiocy and stands up a site saying, "okay, here's some money if you can exploit it."
14. Hours pass.
15. Still no specifics available.
16. Zeitgeist becomes, "I guess it's not exploitable after all."
17. The test site gets 'sploited.
18. Finally somebody actually posts the damn specifics -- namely, the person that grabbed the $2k.
19. Late morning local time on the 26th, and the conversation becomes, "well, obviously this was exploitable!" <-- we are here
Coincidentally, I just started reading Crisis Engineering, which seems like an excellent and applicable book, but I'm not sure who to beat with it.
Comment by akerl_ 2 days ago
We could have skipped from 7 to 19 if folks had just taken seriously the guidance from experts in the field.
Comment by tptacek 2 days ago
Comment by thaumaturgy 2 days ago
There's not a chance in hell that even half of the world's PHP has been updated, so I would expect that if we start seeing large-scale exploitation, those people will change their opinion pretty fast.
Being totally burned out on AI hype myself, I'm somewhat sympathetic towards the folks that are still thinking of this as just another example of that.
Comment by gewetensleegte 2 days ago
I mean, it was also that it was marketed in the media as a security apocalypse and unpatched servers would be falling within 15 minutes after the patch got released. This didn't happen. And that definitely warranted skepticism. There's been MUCH more severe vulnerabilities in the past that just went by without OpenAI's marketing making everyone go crazy about it.
Also, almost all information about it was dressed up in slop. Because OpenAI didn't want us to forget that AI was involved, somehow.
Comment by gewetensleegte 2 days ago
you keep repeating this, also when people make very valid other criticisms, such as the hype causing government websites to be pre-emptively shut down -- do you believe this was warranted?
because that is the criticism.
nobody, including that "PHP vuln isn't so bad" blog article, which was VERY clear about this, said you shouldn't patch your servers
what's worrying is that you keep making up straw men, but why?
this isn't about the vulnerability, it's about OpenAI's Patch The Planet hype train
Comment by tptacek 2 days ago
Comment by anonymous908213 1 day ago
Comment by tptacek 1 day ago
Comment by anonymous908213 1 day ago
AI company tells you their AI was used to find the biggest vulnerability EVER, with much fanfare. Zero cases of exploitation in the wild. Zero publicly demonstrated PoCs. It would almost be weirder to not be skeptical at that point unless you for some reason trusted everything a marketing department says implicitly.
> These findings rank among the most severe vulnerabilities discovered in PHP, and arguably in software history.
See also the parable "Boy Who Cried Wolf" for more insight into the human condition.
Comment by rcxdude 2 days ago
Comment by gewetensleegte 2 days ago
https://calif.io/php2shell/#patch-the-planet
I mean what is the world coming to when security researchers cannot release a writeup that is designed to look like slop, and starts with a bunch of cartoons with lame cyberpunk and matrix references, without being ridiculed for taking the piss ...
Comment by rcxdude 2 days ago
Comment by billypilgrim 2 days ago
Comment by tptacek 2 days ago
Comment by jdiff 3 days ago
Comment by yreg 3 days ago
If you think so then express it clearly, I'm interested in those thoughts.
–––
Apparently the challenge was dubious so I’m not sure what to draw from it in the end.
Comment by vikramkr 1 day ago
Comment by akerl_ 2 days ago
Evidence has shown they were pretty spot on about the first part (the test originally served static html, the php code wasn’t actually as vanilla as described, and the bitcoin key wasn’t actually there).
I’d have hoped this kind of clear vindication on the first point might have caused folks to revisit their stance on whether to trust the expert stance on the second. But maybe I’ve been overly optimistic.
Comment by yreg 3 days ago
> The fact that people are still in denial over this is crazy.
Maybe you misunderstand what I say.
Imagine the tens of millions of personal or small business websites running php. What's your guess, what portion of the unpatched ones is already pwned? Is it 1%? 5%? 15%? 50%? 95%?
What would you guess?
Comment by krial 3 days ago
Comment by kennywinker 3 days ago
Comment by MartijnHols 3 days ago
Comment by Sir68k 3 days ago
Comment by tim1994 2 days ago
Comment by yreg 3 days ago
Comment by vikramkr 1 day ago
Comment by FergusArgyll 3 days ago
Comment by pwython 3 days ago
"The winning chain deliberately used per-request memory exhaustion, which appears to violate the literal no-resource-exhaustion rule, although the organizer accepted the win."
Comment by krzyk 3 days ago
Comment by someothherguyy 3 days ago
Comment by dncornholio 2 days ago
Comment by phyzome 2 days ago
Comment by fishgoesblub 3 days ago
Comment by synarchefriend 3 days ago
Comment by niallmurphy-ie 3 days ago
Comment by stackghost 3 days ago
It wasn’t that difficult of an exploit, to be honest. I myself am not the leetest of the leet but I was most of the way there, having been set back by the downtime and my time zone. It’s definitely a fiddly, tricky exploit as most memory exploits are but I think the initial alarm was justified.
While waiting for the server to come back up, it took me about 3 hours with LLM assistance to write a php2shell RCE for nginx and mediawiki on the same version of php as TFA.
The biggest win, as others have also observe, was the demonstration that there aren’t swarms of automated pwnbots out there that will insta-root your server.
Considering the amount of downtime, I think that flag got got pretty quickly.
Comment by FreakLegion 3 days ago
There are, they just didn't have a working exploit. Anyone with a honeypot can tell you attempts were widespread going back to early last week, but it wasn't until Saturday that we started to see successes.
Comment by shawabawa3 3 days ago
Ok but a mediawiki page is obviously not comparable
People were complaining that originally it was just using php to serve a static index.html file
It looks like after 18-19hours they updated it to serve a real .php file and it was hacked less than 2 hours after that
Comment by stackghost 2 days ago
The attack is against the underlying php install, and is application-agnostic, I was merely duplicating the trailofbits POC.