-
Notifications
You must be signed in to change notification settings - Fork 60
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
WIP: support pwndbg as a GDB extension #96
Conversation
The latest change (which made sense in the first place) shifts the error in a different direction:
After hitting
|
We spoke about this on Discord, but I will document this here as well. This fails because And you launch the two - qemu-system (the linux vm) - and the GDB - in two separate containers. As a result, they end up in two different PID Linux namespaces and so they cannot see each other"s PIDs/processes. Running the containers with
That"s likely because of AppArmor profile blocking write access to So now running the container additionally with But this isn"t really a great solution. We don"t want people to do all this. A potential solution could be using |
Added
This seems to run "fine", as in it does not fully crash. However, there"s still the problem that the Single-stepping through the instructions was not painfully slow for me. Holding off a merge until a clean solution is found. |
Codecov ReportBase: 89.96% // Head: 89.48% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #96 +/- ##
==========================================
- Coverage 89.96% 89.48% -0.49%
==========================================
Files 18 18
Lines 1954 1968 +14
==========================================
+ Hits 1758 1761 +3
- Misses 196 207 +11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
For completeness, pinging @gsingh93 here as well. I added the following lines to my -ex \"set kernel-vmmap-via-page-tables off\" \
-ex \"set exception-verbose on\" \ Afterward, I ran: ./start_kgdb.py -p5 -y -v
docker run -it --rm --security-opt seccomp=unconfined --cap-add=SYS_PTRACE -v /tmp/kernel_root/linux-5.15_x86_64_:/io --net="host" like_debugger /bin/bash -c "set -e; . /home/user/debugger.sh -a x86_64 -p /io -c 0 -g /home/user/gdb_script -e pwndbg Output: Loading the The |
Both GDB and the QEMU kernel process need to live in the same PID namespace so that gdb-pt-dump can connect to it. If you run those as Docker containers, you need to run them with the However, the fact that gdb-pt-dump is used at all when EDIT: I just realized I repeated myself from a previous comment in regards to --pid=host; sorry! :) |
@disconnect3d No worries, I just had a short little chat with @gsingh93 on the pwndbg discord the other day as he was asking whether there was a problem with remote debugging. So, I just double-checked the current situation. My apologies if this pinged you as well. |
@0xricksanchez If you want to disable the vmmap page table functionality, you should do this (it"s mentioned in the error message in the screenshot):
But |
Actually, does not work for me as I run into the same problems as before? @gsingh93 Is there an overview of what "features" one misses out on, depending on the set options?
I guess that boils down to the same behavior GEF currently has as in |
Ok, I"ll try to reproduce this using like-dbg, thanks for the report.
Mainly it"s vmmap you miss out on like you mentioned, but also anything that requires information about mappings. One example is color coding of addresses based on their permissions. But I"ve been using pwndbg with that config set to none for a few weeks, and there"s been nothing major missing. |
Then I recommend using a ctf challenge with a given kernel and file system, so you don"t have to deal with building a full kernel and file system. On this branch here you"d want to execute ./start_kgdb.py -y -v --ctf <kernel> <filesystem> |
The issue is what @disconnect3d mentioned about PID namespaces.
After doing that however, I was getting a permission error when trying to read But in any case, I think that should at least get you unblocked on this issue. |
8f71201
to
faa08a7
Compare
NOT MERGABLE YET
I"m currently running into a