Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I once wrote an ELF by hand for a CTF challenge. The challenge was to have an shared library such that when it is passed to LD_PRELOAD it spawns a shell by execve

LD_PRELOAD=<ELF> /bin/true

The constraint being the ELF needed to be less than 196 bytes so obviously it could not be created by gcc. In the end I could not believe it ran, considering the amount of hacks that I had to do to trim it to 193 bytes.

https://github.com/TeamGreyFang/CTF-Writeups/tree/master/Pla...



Here's my writeup/solution for the same challenge, represented as a diagram:

https://twitter.com/David3141593/status/1253122980525334529


Your pinned tweet is quite fascinating.


Cool diagram. Putting the shellcode in headers is very innovative. I didn't have too much assembly knowledge to trim it further during the competition.


Yep, it’s fun to see what things glibc will let you get away with ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: