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

Aborted (core dumped) when load specific elf file by python3 pwntools #2296

Open
Marsman1996 opened this issue Nov 7, 2023 · 1 comment
Open

Comments

@Marsman1996
Copy link

Marsman1996 commented Nov 7, 2023

When the pwntools loads a specific elf file by python3, it shows Aborted (core dumped).
The elf file is attached below.
attach.tar.gz

It can be reproduced in the official docker image:

$ docker pull pwntools/pwntools:stable
$ docker run -it \
    --privileged \
    --net=host \
    --hostname localhost \
    --ulimit core=-1:-1 \
    -v $PWD:/workdir \
    pwntools/pwntools:stable
$ python3 getdyn.py libpcl_recognition.so

and the output is

pwntools@localhost:~$ python3 getdyn.py libpcl_recognition.so 
Aborted (core dumped)

However, if I run the pwntool with python2, everything works fine:

pwntools@localhost:~$ python2.7 getdyn.py libpcl_recognition.so 
[!] Could not populate PLT: invalid syntax (unicorn.py, line 110)
amd64

Update Pwntools First

I have updated the pwntools to 4.11.0

pwntools@localhost:~$ python3 -m pip install --upgrade pwntools
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pwntools in ./.local/lib/python3.10/site-packages (4.11.0)

Debug Output

I ran the cmd $ python3 getdyn.py DEBUG LOG_FILE=log.txt libpcl_recognition.so
and the log.txt only shows:

================================================================================
= Started at 2023-11-07T02:25:32                                               =
= sys.argv = [                                                                 =
=   'getdyn.py',                                                               =
=   'libpcl_recognition.so',                                                   =
= ]                                                                            =
================================================================================
@ghost
Copy link

ghost commented Nov 9, 2023

If it's still relevant, I guess the ffi sucks and it is related to the unicorn. A solution can be to try and rebuild unicorn with debug symbols and then checking what exactly happens.

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

No branches or pull requests

1 participant