Oriel — AI & technology worth noticing, every day.

StealMyBitcoin (php2shell CTF) solution writeup

Repository · https://github.com/killaboi/stealmybitcoin-poc

First seen by Oriel on .

AI summary

This GitHub repository releases a single-file Python PoC that exploits PHP upload-progress memory exhaustion to leak addresses and trigger a forged HashTable callback in the Steal My Bitcoin challenge.

  • The PoC targets Alpine PHP 8.4.26 with four CLI-server workers behind nginx and uses only Python's standard library.
  • Multipart requests create deeply nested arrays, exhaust PHP's 128 MiB limit, and leave stale worker state that subsequent requests expose through session cookies.
  • Separate heap and code leaks recover a Zend heap base and zval_ptr_dtor, with strict alignment, length, range, and Alpine fingerprint checks.
  • A final 368,812-byte POST places a forged HashTable and command string where cleanup invokes zif_system, returning execution markers and print-flag output.
  • The documented lab succeeded in 7 of 10 runs; worker races, binary layout, memory settings, and worker count affect reliability.

#php #memory corruption #ctf #python

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Points

Score reported by the source.

  • Hacker News: 171, latest observation ; +156 over observed period since
  • Lobsters: 1, latest observation

Comments

Comment count reported by the source.

  • Hacker News: 59, latest observation ; +57 over observed period since
  • Lobsters: 0, latest observation

Aliases

SourceExternal IDURL
Hacker News50237379https://github.com/KillaBoi/StealMyBitcoin-PoC Read discussion
Lobstersthodsxhttps://github.com/KillaBoi/StealMyBitcoin-PoC/blob/f394a6065f01f0afd48b867404017de01cd9811b/README.md Read discussion