Coder Social home page Coder Social logo

Could not find libc about pyinjector HOT 10 CLOSED

auxsvr avatar auxsvr commented on May 27, 2024
Could not find libc

from pyinjector.

Comments (10)

kmaork avatar kmaork commented on May 27, 2024

What process are to trying to inject to? Could you post here its /proc/<pid>/maps?

from pyinjector.

auxsvr avatar auxsvr commented on May 27, 2024

It's pylsp, here is the file maps.txt.

from pyinjector.

kmaork avatar kmaork commented on May 27, 2024

Your environment seems a bit unusual - is it possible /usr/lib64/libc.so.6 is not a symlink on your machine? Please post the output of ls -l /usr/lib64/libc.so.6

from pyinjector.

auxsvr avatar auxsvr commented on May 27, 2024

> ls -l /usr/lib64/libc.so.6
-rwxr-xr-x 1 root root 2,5M Dec 6 00:00 /usr/lib64/libc.so.6

Indeed, it's not a symlink. It's on openSUSE Tumbleweed.

from pyinjector.

kmaork avatar kmaork commented on May 27, 2024

Fixing this requires a change in kubo/injector - https://github.com/kubo/injector/blob/master/src/linux/elf.c#L257 will need to support libc.so.6 (and probably libc.so too) instead of just libc-2.xx.so. I see this issue has surfaced in kubo/injector as well - kubo/injector#15.
Until it is resolved, there is a hacky workaround,
Run:

mkdir /tmp/libc && \
sudo ln /usr/lib64/libc.so.6 /tmp/libc/libc-2.31.so && \
ln -s libc-2.31.so /tmp/libc/libc.so.6 && \
ln -s libc.so.6 /tmp/libc/libc.so

And then run processes you want to inject with LD_LIBRARY_PATH set:

LD_LIBRARY_PATH=/tmp/libc <cmd_to_debug>

from pyinjector.

auxsvr avatar auxsvr commented on May 27, 2024

Ran the above with the difference that I used symbolic links everywhere, as /tmp is a different filesystem, to no avail; the error message is the same.

from pyinjector.

kmaork avatar kmaork commented on May 27, 2024

The hard link is required, try running it as I posted just in a different directory in the same filesystem.

from pyinjector.

kmaork avatar kmaork commented on May 27, 2024

Kubo has fixed the issue in injector, I released pyinjector==1.0.6 with these changes. Please let me know if it works for you :)

from pyinjector.

auxsvr avatar auxsvr commented on May 27, 2024

The new version works fine, thank you for the prompt response!

from pyinjector.

kmaork avatar kmaork commented on May 27, 2024

Great to hear, thank you for posting the issue :)

from pyinjector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.