0xricksanchez / like-dbg

Fully dockerized Linux kernel debugging environment
MIT License
730 stars 58 forks source link

like_debugger appears to not be tagged correctly #165

Closed R3zk0n closed 8 months ago

R3zk0n commented 10 months ago

Describe the bug It appears like on a clean build of like-dbg, the like_debugger docker image isn't being tagged sometimes, manually forcing the tag seems to break the the gdb script to the vm-linux.

To Reproduce Steps to reproduce the behavior:

    • latest
  1. ./start_kgdb.py
  2. Standard

Expected behavior The script deploys and builds everything however often the docker image for the debugger isnt tagged, maybe a way to force the tagging to prevent this type of issues?

Screenshots

image image

Desktop (please complete the following information): Fill me in on the specs of your environment:

  1. Operating system (e.g.: cat /etc/os-release) -

    image
  2. Python version (python --version) - python 3.10.4

  3. Python packages (in your virtualenv: pip freeze)

  4. Docker version (docker --version)

    image

Additional context Tried it on multiple different systems, and virtual machines and appears to always be the same issue.

0xricksanchez commented 10 months ago

@R3zk0n thanks for reporting this! I’ll take a look asap. I’m in the middle of moving so I hope I get around to fixing this soon. PRs welcome :)

R3zk0n commented 10 months ago

All good, will do my best to try to fix and then submit a PR, seems like the issue might be in the docker_runner.py

R3zk0n commented 10 months ago

OK! I am back so i think ive worked out the issue,

it appears that the like_debugger isnt being tagged, and isnt installing gef correctly which cause it not be able to continue and use the remote debugging due gef-remote not being installed which makes sense, demostrated below

image

But mainly forcing the tagging of the container then installing gef, seems to make it work fine, image image

Not exactly where to make the edit to force the gef to be installed, since in theory it should already be done but i guess doing a execute to confirm gef is installed in the container if not bail out would be useful, trying to find where to add it but once i do ill do a commit! :)

0xricksanchez commented 10 months ago

The GEF "installation" happens in the .dockerfile_dbg: https://github.com/0xricksanchez/like-dbg/blob/main/.dockerfile_dbg#L44. There are no sanity checks if the command did not crash 😬

R3zk0n commented 9 months ago

Tried to use a bash script to replace the build but for some reason it runs in the wrong context, still working on it. :D

R3zk0n commented 9 months ago

171 Hopefully this should be fixed now.