-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add support for gef-remote in gdb.attach #2264
Comments
Hm, how would you detect if gef is installed in gdb from the exploit script? Running the detection in python in gdb appears to be the easiest way indeed. I am not sure in which context the commands get executed by |
Detecting if gef is installed from the exploit script does not seem like something we can do easily. The only way I can see to detect it is directly from gdb. And about your question, afaik |
I don't think having some |
I wonder why GEF does not overwrite the default behaviour if it is unsupported; maybe they could 'fix' it? Pwndbg for example detects what happens on the other end and then adapts (with monitor commands). Nevertheless, can you try to implement that in the default gdbscript preamble used in pwntools and submit it as a pull request? It should be as easy as |
After discussing this with @hugsy, probably the best way to resolve this issue is to resolve it directly in gef. |
Cool, please keep us updated here! |
Any news? |
Sorry, I did not have much time those days. |
As mentioned in Gallopsled/pwntools#2264, gef does not work properly with many tools that rely on the `target remote` command. In this PR, I propose a fix that uses a remote posthook in order to instantiate and setup the GefRemoteSessionManager after the connection being established. Note that this isn't a perfect solution since we do not have all the information needed for a proper instantiation of the GefRemoteSessionManager, but it seems to be a good workaround in order to make tools like `pwntools` work correctly with gef.
Appears to be fixed in gef. Thank you @ValekoZ! |
It would be nice if there were some option in pwntools that let us override the command issued for a remote session. That way detection would be unnecessary, but we could explicitly overwrite it to e.g. |
Do you have a use case in mind where you need this? I thought gef works now with target remote? |
It would be a nice feature to be able to use gef-remote when using gef instead of the traditional
target remote
used in gdb.attach and maybetarget extended-remote
used here for instance.Maybe something like the following could do the trick ?
This could also be a nice feature to add better support for qemu debugging ? I didn't really tested how it works atm but I guess using the qemu-mode should improve it for
gef
users.The text was updated successfully, but these errors were encountered: