NewsLab
Oct 27 15:34 UTC

PHP2Shell: Exploitation Attempts and Remediation Trends (wiz.io)

94 points|by acossta||34 comments|Read full story on wiz.io

Comments (34)

31 shown
  1. 1. xx_ns||context
    "No successful PHP2Shell exploits seen so far"... in the wild, specifically in Wiz's honeypot. The vulnerability itself has been successfully exploited, most notably for the "Steal my Bitcoin" challenge [1] as one example.

    Dan Guido, of Trail of Bits, claims they have an "universal" exploit [2]. Knowing their track record, I don't currently have a reason to doubt this claim.

    [1]: https://stealmybitcoin.com/

    [2]: https://news.ycombinator.com/item?id=50226010

    EDIT: The HN title has been changed since posting this comment.

  2. 2. paxy||context
    It's funny that when stealmybitcoin.com was posted on HN (https://news.ycombinator.com/item?id=50224916) there were hundreds of top voted comments saying "see no one has been able to steal it, the reported vulnerability was fake, it's all AI marketing" etc.

    Since it was successfully exploited there has been zero further discussion, and I bet most people who participated in the original thread aren't even aware.

  3. 3. ForHackernews||context
    Two things can be true:

    1) A motivated human eager for $500 and internet cred can exploit a vuln (perhaps using AI tooling to help)

    2) The vuln is not easily exploitable at scale by driveby bots.

  4. 4. NitpickLawyer||context
    IIUC, the first setup couldn't be exploited because the site didn't run any php. You kinda need the server to run some php if you're gonna use a php vuln. It got solved ~2h after they added a php-version.php ...
  5. 5. syshyk||context
    The main kickback was against the hype and it was "so easy for AI" and would take "15 minutes to compromise everything".

    Either way, this was not true.

  6. 6. Tadpole9181||context
    The author didn't even have an accessible PHP server at first. When they actually added one, it got cracked in 2 hours.
  7. 7. milkshakes||context
    also it was under hn load which makes this much harder
  8. 8. NorwegianDude||context
    HN load isn't exactly a high load for a server. The automated traffic was most likely much higher, but not high, as the server used the super slow single threaded php dev http server, so high traffic was not possible, everyone had to wait their turn.
  9. 9. jgalt212||context
    yes, but 70% of the world's websites were (and many still are) accessible PHP server(s) that hand not been patched.
  10. 10. howunfortunate||context
    To be fair, he hasn't had time to do the write up yet. When he does I fully expect it to hit the front page.
  11. 11. Topfi||context
    The person that succeeded already published [0]. Thread is barely active compared with the amount of engagement the challenges announcement received.

    [0] https://news.ycombinator.com/item?id=50237379

  12. 12. fwlr||context
    As one of those comments I dispute your characterization of it as the reported vulnerability being fake, very few people were saying that. The main thing being called fake was the narrative that with AI it was trivial to exploit the vulnerability.

    It has not escaped me that the successful exploit did in fact just say “codex, exploit this” and got it.

    I had assumed the rash of commenters saying “lol I am not revealing my AI’s exploit for a measly 500 bucks” were saying that because their AI attempt failed. Now I know they didn’t even try!

  13. 13. nubinetwork||context
    Just last week companies were saying php2shell has been rampant for months, but if that were the case, wouldn't we all have strange errors in our logs? Something seems fishy to me.
  14. 14. jagged-chisel||context
    Should we expect logs from a compromised system to be truthful?
  15. 15. minitech||context
    Which companies? The earliest claim of an exploit attempt in the wild I had heard was October 17th, and that was “extant”, not “rampant”.

    I don’t suppose you’re thinking of when the issue was discovered? That was August 1st, according to https://calif.io/php2shell/#the-discovery.

  16. 16. nubinetwork||context
    Amazon said 4 days prior to patch, but I'm pretty sure the other one was cloudflare, I can't find the link in my browser history.
  17. 17. minitech||context
    So was “months” a typo for “4 days” or what?
  18. 18. cimi_||context
    More details about stealmybitcoin in LiveOverflow's video: https://www.youtube.com/watch?v=VhNiMWtOutw

    This is the winner: https://github.com/KillaBoi/StealMyBitcoin-PoC

    The challenge website was not exploitable at launch because it wasn't actually running PHP; it got cracked in two hours aftewards

    In the video, LiveOverflow shows his exploit that reliably gets RCE from two requests.

  19. 19. NorwegianDude||context
    The steal my Bitcoin challenge was nothing like a realistic common PHP setup. It was a extremely unrealistic and stupid setup, using the built in php dev server. It's even explicitly stated that it should never be exposed to the internet.

    If it needs to hit the same worker to get it to work, that is a whole other problem, and that was not a part of the steal my bitcoin challenge. And what if pm.max_requests is set to 1? Is it then 100 % safe, as it respawns for each requests, making any statement for an universal exploit completely BS, or is a single requests exploit possible?

  20. 20. idoubtit||context
    As far as I know, there has been no proven vulnerability on a modern PHP (production) stack. The "Steal my Bitcoin" challenge was a toy project. The "lab" target used the embedded PHP server (`php -S`) which is for development only.

    > Warning. This web server is designed to aid application development. [...] It should not be used on a public network. https://www.php.net/manual/en/features.commandline.webserver...

    There are 3 main PHP interfaces (SAPI):

    1. mod_php which is obsolete and requires Apache prefork (which should also be avoided)

    2. php-fpm (FastCGI) which has been the default for more than a decade.

    3. FrankenPHP is a new official interface much more suitable for containers.

    There were 2 vulnerabilities.:

    1. "OOM corruption". The advisory says there was a proven exploit with mod_php, but only for that obsolete SAPI. "Source analysis therefore supports FPM as a susceptible, though *no complete FPM exploit* has been demonstrated for this SAPI."

    2. "stale global state". The advisory is The last PHP release (8.5) was vulnerable when the debug parameter fatal_error_backtraces was on. There was a suspicion that an exploit could exist in the session code for php-fpm, but it was unproven and probably unrealistic.

    The "evidence" given at the end of the article seems old news to me. The honeypot was based on Apache-prefork + mod_php. As stated in the CVE, there is a proven exploit for that (obsolete) stack.

  21. 21. 6_7||context
    I'm so sorry, exposure is down how many percent?
  22. 22. rprouse||context
    And at the same time Bleeping Computer is saying it has been successfully exploited, https://www.bleepingcomputer.com/news/security/php2shell-sec...
  23. 23. larahawkinsauth||context
    Great Breakdown
  24. 24. EGreg||context
    A lot of PHP environments were set up years ago, and run versions below PHP 8.1. If they don’t do something, eventually, they might be exploited, and turned into botnets or worse. A lot of the old PHP forums and other websites might get back door doors and impersonate people, etc.

    I developed a proxy that sanitizes input before it reaches PHP. I had to put it together quickly, but since then, I’ve made it a lot more user-friendly, including PHP installation scripts that automatically scan your Web server configuration, and suggest exactly how to install the proxy. The proxy itself is written in C, and I recommend running it under a Linux user that has absolutely no file permissions. All it’s supposed to do is transform input into safe output. I would argue that this proxy might even be safer than the patch, because it might prevent other vulnerabilities that researchers haven’t found yet.

    It’s just a generally good idea to sanitize input before it reaches your app servers anyway. But if you are running and older PHP environment, I don’t think there are any other good options than this…

    https://github.com/Qbix/proxy

  25. 25. doctoboggan||context
    Maybe a grey hat should scan for all the vulnerable servers they can find, exploit them, and then patch them.
  26. 26. ghostbrainalpha||context
    That's the definition of a White Hat to me.
  27. 27. pizzafeelsright||context
    If there was a well known company, TrustedExploitAndPatch Inc, that had faces and contact info and dropped an 'oh by the way.txt' file with the details, screen recording, etc. after patching showing they didn't exfil all the coins - would people be happy?

    Even if someone finds your wallet and returns it, full of its original cash, they still would have had time to snag your credit card numbers, figure out your address, what coupons you have.

    The alternative is a guy in a suit walking up and saying "I saw your wallet in the bushes on 144th and 132nd."

  28. 28. minitech||context
    - please stop spamming this

    - but anyone who deploys thousands of lines of vibe-coded C that implements a transforming HTTP proxy from scratch instead of a patch (hey, it “might even be safer than the patch”!) deserves what they get

    edit: shocker https://news.ycombinator.com/item?id=50199456

  29. 29. makmanalp||context
    This has been my hyperfixation for the last few days, and I've been trying to keep together a detailed and timestamped timeline of the evolving situation:

    https://claude.ai/artifact/5cZex56WutyVnpMBrWXxzV

    TLDR is multiple entries that show successful exploitation against particular setups (quite often honeypots that were kinda set up to be exploitable e.g. single worker mod_php or lab setups that are unclear on how well they match real deployments), one claim from dan guido / trail of bits about a broad exploit (but few details), millions of attempts in the wild but very little evidence of actual compromise (unit 42 withdrew theirs).

  30. 30. phplovesong||context
    PHP just sucks so bad.
  31. 31. denysvitali||context
    > but these scanners did successfully exploit Adel Karimi's honeypot, which was a likely contributing factor to CISA’s decision to include PHP2Shell in their KEV list.

    Adel is doing an amazing job. Both in open source (https://github.com/perplexityai/bumblebee, https://github.com/perplexityai/numbat, https://github.com/0x4D31/galah) and with his reports.

    So proud of him!