Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find libc #40

Open
htjain opened this issue Aug 24, 2022 · 1 comment
Open

Could not find libc #40

htjain opened this issue Aug 24, 2022 · 1 comment

Comments

@htjain
Copy link

htjain commented Aug 24, 2022

getting following error while running on ubuntu docker image:

Traceback (most recent call last):
File "/usr/local/bin/madbg", line 8, in
sys.exit(cli())
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/madbg/main.py", line 34, in attach
attach_to_process(pid, port, connect_timeout=timeout)
File "/usr/local/lib/python3.8/dist-packages/madbg/api.py", line 34, in attach_to_process
_inject_set_trace(pid, ip, port)
File "/usr/local/lib/python3.8/dist-packages/madbg/api.py", line 28, in _inject_set_trace
inject_py(pid, f'import("signal").signal({sig_num},lambda _,f:import("madbg").set_trace(f,"{ip}",{port}))')
File "/usr/local/lib/python3.8/dist-packages/hypno/hypno.py", line 20, in inject_py
inject(pid, str(copied_lib))
File "/usr/local/lib/python3.8/dist-packages/pyinjector/pyinjector.py", line 95, in inject
injector = Injector.attach(pid)
File "/usr/local/lib/python3.8/dist-packages/pyinjector/pyinjector.py", line 77, in attach
call_c_func(libinjector.injector_attach, byref(injector_p), pid,
File "/usr/local/lib/python3.8/dist-packages/pyinjector/pyinjector.py", line 66, in call_c_func
raise exception_cls(func.name, ret, libinjector.injector_error())
pyinjector.pyinjector.InjectorError: injector_attach returned -4: Could not find libc

@kmaork
Copy link
Owner

kmaork commented Aug 25, 2022

Thank you for the report @htjain!
Can you provide more details? I tried recreating the issue by:

docker run -it python:latest bash
pip3 install madbg
python -c "while 1:1" &
madbg attach $!

And it worked for me.

I'd like to know:

  1. How you installed madbg
  2. How you invoked madbg
  3. What version of the ubuntu image you were using
  4. How you invoked the process you tried attaching to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants