Tom Kroll

Learning about programming, reverse engineering, binary exploitation, and everything else I can about cybersecurity


Overwriting entries in the Global Offset Table

22 Dec 2024

This write-up builds on what was learned about exploiting printf vulnerabilities in my write-up on the picoCTF format string 2 challenge. In the format string 3 challenge there is a similar vulnerability, but this time instead of overwriting a variable within the program it will be used to overwrite a pointer to an entry in the Global Offset Table so that it will call a different libc function.

Sections:

  1. format string 3
  2. The Global Offset Table
  3. Final Exploit

After running this script we have a shell on the remote server and can just cat the flag.txt file!
(I wasn't able to do this in the picoCTF webshell and had to use a Kali VM)

I hope this was helpful. This challenge was a great way to learn about the Global Offset Table and also get some practice with gdb and pwntools. Reverse engineering and binary exploitation are the most fun things I have learned about so far on my cybersecurity journey!


Feedback is welcome and encouraged! Please leave a comment below: