Writeup for the Nightmare CTF Challenge from 2022 DiceCTF

TLDR: One byte write, no leak.

  1. Infinite loop through overwrite of binaries link map
  2. Determination of useful rop gadget, has to fit several extensive criteria
  3. Partial overwrite of DT_JMPREL table pointer
  4. Partial overwrite of DT_STRTAB pointer
  5. Overwrite of LIBC link map
  6. Loop 2-5 until rop chain has been created
  7. Partial overwrite of DT_FINI_ARRAYSZ pointer
  8. Use 3 & 4 to call exit, to call rop chain

Prologue

This challenge was extremely difficult and I recommend reading the original author’s writeup to see how intense the intentional method is, https://hackmd.io/@pepsipu/ry-SK44pt. Now with that mentioned, I’m going to show you a method that ignores most of the primatives stated in the article and go a complete different approach that even the author thought was impossible.

 

To finish reading, please visit source site