You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the gdb.debug fails to launch binary under gdbserver it shows a not-super-obvious error. This might happen for example when one sets LD_PRELOAD to load different libc library.
Example
NOTE: I had to run sudo apt-get update && sudo apt-get install gdbserver first.
NOTE2: I have used /bin/bash as LD_PRELOAD but that could be a .so library not compatible with the binary (e.g. wrong arch).
pwntools@a0b508e4b82d:~$ python -c 'from pwn import *; gdb.debug("/bin/ls", env={"LD_PRELOAD": "/bin/bash"})'
[+] Starting local process '/usr/bin/gdbserver': pid 254
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pwnlib/context/__init__.py", line 1349, in setter
return function(*a, **kw)
File "/usr/local/lib/python2.7/dist-packages/pwnlib/gdb.py", line 396, in debug
port = _gdbserver_port(gdbserver, ssh)
File "/usr/local/lib/python2.7/dist-packages/pwnlib/gdb.py", line 233, in _gdbserver_port
gdbserver.pid = int(process_created.split()[-1], 0)
ValueError: invalid literal for int() with base 0: 'ignored.'
[*] Stopped process '/bin/ls' (pid 254)
pwntools@a0b508e4b82d:~$
The text was updated successfully, but these errors were encountered:
disconnect3d
changed the title
Better errors for gdb.debuggdb.debug not so obvious error msg
Nov 25, 2017
When the
gdb.debug
fails to launch binary under gdbserver it shows a not-super-obvious error. This might happen for example when one setsLD_PRELOAD
to load different libc library.Example
NOTE: I had to run
sudo apt-get update && sudo apt-get install gdbserver
first.NOTE2: I have used
/bin/bash
asLD_PRELOAD
but that could be a .so library not compatible with the binary (e.g. wrong arch).The text was updated successfully, but these errors were encountered: