-
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
Can't attach to gdb on ArchWSL(WSL2). #2464
Comments
If this is your whole script, the problem is that your exploit script terminates and takes the target process with it before gdb has a chance to attach. Usually adding a A different issue appears to be the
That should block execution in your exploit script until the debugger is actually attached. If you manage to fix it, please open a pull request! Line 391 in d7817a7
|
Actually it's not the whole script. I omitted some code.
I think here is the key point.(This may be caused by the ptrace error) Actually I need to add a "-- sudo" to the context.terminal so that I can temporarily attach to the gdb. But this means I need to prefix each script with context.terminal. |
@Xunflash Dude, I does not recommend using Arch Linux in WSL2 as neither Microsoft nor Arch has official support for Arch/WSL2. I have a friend who used Arch/WSL2 first, and praised how convenient yay is. But some infrustructure like systemd couldn't behave like real Arch Linux. So he ended up using back Ubuntu/WSL2. In my opinion, Ubuntu is suitable for WSL2 and Arch Linux is suitable for physical system. If you would like to try Arch Linux, I only suggest Dual boot with Windows, and separate them in different disks to avoid efi corrupt if you have two. |
I can't attach to gdb, details on the outputs below:
and I get the following output
I searched the error (ptrace: Operation not permitted.) on google and I found the following wiki:
https://github.com/Microsoft/MIEngine/wiki/Troubleshoot-attaching-to-processes-using-GDB
so I exeuted the second option's command because my wsl don't support yama (it shows "no such file or directory.")
sudo setcap cap_sys_ptrace=eip /usr/bin/gdb
But still not working.
The text was updated successfully, but these errors were encountered: