0

I'm running ubuntu 20.04, and I'm tryying to run a python pwn script that has the following line:

libc = ELF("./libc.so.6")

Which fails with:

No such file or directory: './libc.so.6'

So I check my libc version (for the file i'm trying to target):

$ ldd r2c
        linux-vdso.so.1 (0x00007ffdd95e1000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2505727000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2505938000)

and I try to update the python script accordingly

libc = ELF("./lib/x86_64-linux-gnu/libc.so.6 ")

But this fails in the same manner. I then check this file:

$ file /lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libc.so.6: symbolic link to libc-2.31.so

Which apparently is just a symlink to some other libc version? how does that make sense?

Can I do something to fix this?

1 Answer 1

0

In both cases, you're telling your program to look in the current directory by specifying ./. Remove the ., and you'll start the search at /, the root directory of the whole file system

1
  • This has the same effect
    – Grazosi
    Mar 31, 2022 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .