Fix attaching to a gdbserver with tuple gdb.attach(('0.0.0.0',12345))#2291
Fix attaching to a gdbserver with tuple gdb.attach(('0.0.0.0',12345))#2291peace-maker merged 4 commits intoGallopsled:devfrom
gdb.attach(('0.0.0.0',12345))#2291Conversation
|
Alright, now I see the error is there. But the error is in a different place.
Your fix breaks all other use cases, the proper fix would be to change the pidof() functionality in GDB to use I think pwning servers is more common than pwning clients [citation needed™], so this logic can be inverted to find a process listening on (host,port) instead of the one connected to (host,port). |
|
Actually, we meet this bug when we use gdb.attach to Qemu gdbstub ... |
|
This went under my radar for a while :D I've hit this too this weekend and I think it's fine to assume we're looking for the server providing the port instead of a client being connected to a port. It seems the logic in Lines 262 to 273 in 5981c72 |
gdb.attach(('0.0.0.0',12345))
5e7276f to
ddbdfc9
Compare
Instead of returning the process which is connected to port 1234, return the process which is listening on that port.
fix for issues/2290