I was playing with pwntools. I can connect to gdb to local process.
p = process()
gdb.attach(p)
Like this. But if I wanna attach gdb to a remote process it throws error.
p = remote(ip, port)
gdb.attach(p)
It throws this error:
[ERROR] Could not find remote process (10.10.207.165:9002) on this machine
Traceback (most recent call last):
File "/home/pegasus/Documents/tryhackme_pwn/challenge2/exploit2.py", line 19, in <module>
gdb.attach(p, '''
File "/usr/lib/python3/dist-packages/pwnlib/context/__init__.py", line 1578, in setter
return function(*a, **kw)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pwnlib/gdb.py", line 926, in attach
log.error('Could not find remote process (%s:%d) on this machine' %
File "/usr/lib/python3/dist-packages/pwnlib/log.py", line 439, in error
raise PwnlibException(message % args)
pwnlib.exception.PwnlibException: Could not find remote process (10.10.207.165:9002) on this machine
[*] Closed connection to 10.10.207.165 port 9002
How can I fix it? I think pwntools now supports connecting gdb directly to remote objects.