0

Background is I am looking at an old CTF challenge from pico-CTF. You do have the Makefile, the binary itself and the correspondig libc file available. However the binary will not run on my machine but abort with a segmentation fault. According to a writeup I have available this is due to the mismatched linker (ld-linux-xxxxx.x.so) on the local machine. In the writeup he then uses a different ld-file and everything is fine. So I would like to know how can you figure out which ld-file you need to use. I know you can then use patchelf with the --set-interpreter option to run that binary normally but how to know which linker to use blows my mind. Would be great if anyone can give me some insight into that or at least point me to some link where I can readup on that. so far I havent found anything useful yet.

Thanks in advance.

Zapho Oxx
  • 275
  • 1
  • 16

1 Answers1

1

Ok, so I just figured it out with the help of a friend. You can check the exact libc version first either because it is given with the libc filename or by using

strings libc.so.6 | grep -i libc

in my case the libc file is just named like that. the result will then give you something like

libc-2.27.so

The corresponding linker should then just be something like ld-linux-2.27.so.2 which you can easily google and download. Or google by 'linker 2.27' or similar.

Best

Zapho Oxx
  • 275
  • 1
  • 16