All Projects → Wenzel → Pyvmidbg

Wenzel / Pyvmidbg

Licence: gpl-3.0
LibVMI-based debug server, implemented in Python. Building a guest aware, stealth and agentless full-system debugger

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyvmidbg

metal.test
Deprecated, superseded by https://github.com/metal-ci/test
Stars: ✭ 41 (-78.65%)
Mutual labels:  debugger, gdb
Dlangide
D language IDE based on DlangUI
Stars: ✭ 358 (+86.46%)
Mutual labels:  debugger, gdb
madbomber
Backtrace-on-throw C++ exception logger
Stars: ✭ 17 (-91.15%)
Mutual labels:  debugger, gdb
kakoune-gdb
gdb integration plugin
Stars: ✭ 44 (-77.08%)
Mutual labels:  debugger, gdb
Gdbgui
Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.
Stars: ✭ 8,339 (+4243.23%)
Mutual labels:  debugger, gdb
gdb-dashboard
Modular visual interface for GDB in Python
Stars: ✭ 8,699 (+4430.73%)
Mutual labels:  debugger, gdb
insight
A Tcl/Tk Frontend for GDB. This is an AppImage(Portable Package) of insight for the sake of Jeff Duntemann's amazing book.
Stars: ✭ 31 (-83.85%)
Mutual labels:  debugger, gdb
esp-gdbstub
ESP8266 debugging tool
Stars: ✭ 13 (-93.23%)
Mutual labels:  debugger, gdb
Rr
Record and Replay Framework
Stars: ✭ 6,469 (+3269.27%)
Mutual labels:  debugger, gdb
Voltron
A hacky debugger UI for hackers
Stars: ✭ 5,599 (+2816.15%)
Mutual labels:  debugger, gdb
gdb
Go GDB/MI interface
Stars: ✭ 70 (-63.54%)
Mutual labels:  debugger, gdb
Gdb Frontend
☕ GDBFrontend is an easy, flexible and extensionable gui debugger.
Stars: ✭ 2,104 (+995.83%)
Mutual labels:  debugger, gdb
vim-easydebugger
A VIM multi-language debugger plugin
Stars: ✭ 47 (-75.52%)
Mutual labels:  debugger, gdb
lldbg
A lightweight native GUI for LLDB.
Stars: ✭ 83 (-56.77%)
Mutual labels:  debugger, gdb
hello-world-gdb
Simple hello world program for debugging with gdb
Stars: ✭ 29 (-84.9%)
Mutual labels:  debugger, gdb
gdbstub
An ergonomic and easy-to-integrate implementation of the GDB Remote Serial Protocol in Rust, with full no_std support.
Stars: ✭ 158 (-17.71%)
Mutual labels:  debugger, gdb
Gdbghidra
gdbghidra - a visual bridge between a GDB session and GHIDRA
Stars: ✭ 251 (+30.73%)
Mutual labels:  debugger, gdb
gdbundle
Minimalist plugin manager for GDB and LLDB
Stars: ✭ 72 (-62.5%)
Mutual labels:  debugger, gdb
Lldb
Project moved to: https://github.com/llvm/llvm-project
Stars: ✭ 412 (+114.58%)
Mutual labels:  debugger, gdb
Unidbg
Allows you to emulate an Android ARM32 and/or ARM64 native library, and an experimental iOS emulation
Stars: ✭ 1,168 (+508.33%)
Mutual labels:  debugger, kvm

pyvmidbg

Slack Build Status Join the chat at https://gitter.im/pyvmidbg/Lobby standard-readme compliant

LibVMI-based GDB server, implemented in Python

Table of Contents

Overview

This GDB stub allows you to debug a remote process running in a VM with your favorite GDB frontend.

By leveraging virtual machine introspection, the stub remains stealth and requires no modification of the guest.

Why debugging from the hypervisor ?

Operating systems debug API's are problematic:

  1. they have never been designed to deal with malwares, and lack the stealth and robustness required when analyzing malicious code
  2. they have an observer effect, by implicitly modifying the process environment being debugged
  3. this observer effect might be intentional to protect OS features (Windows PatchGuard/Protected Media Path are disabled)
  4. modern OS have a high degree of kernel security mechanisms that narrows the debugger's view of the system (Windows 10 Virtual Secure Mode)
  5. debugging low-level processes and kernel functions interacting directly with the transport protocol used by the debug agent can turn into a infinite recursion hell (eg. debugging TCP connections and having a kernel debug stub communicating via TCP)
  6. in special cases the "Operating System" lacks debugging capabilities (unikernels)

Existing solutions like GDB stubs included in QEMU, VMware or VirtualBox can only pause the VM and debug the kernel, but lack the guest knowledge to track and follow the rest of the processes.

Project presentation at Insomni'Hack 2019:

Vision

vmidbg

Current support:

  • Stubs:
    • GDB
  • Hypervisors:
    • Xen
    • KVM

State of hypervisor's VMI support

  • Xen
    • 2011: Xen 4.1: first hypervisor to support VMI upstream
    • 2015: Xen 4.6: best hypervisor for VMI
    • libvmi: fully supported
    • pyvmidbg: supported
  • KVM
    • 2017: BitDefender published a set VMI patches on the mailing list
    • libvmi: support is ongoing, see kvm-vmi/libvmi (branch kvmi)
    • pyvmidbg: supported
  • VirtualBox
  • VMware/Hyper-V: no sign of interest as of today

Features

  • attach to existing process
    • Windows: find EPROCESS and ETHREADS state
    • Linux: pause at CR3 load
  • attach new process (entrypoint):
    • Windows: follow first thread creation and break at entrypoint
    • Linux: not implemented
  • singlestep/continue: wait for the process to be scheduled
    • process must have a single thread
  • breakin (CTRL-C)
  • software breakpoints

Requirements

Install

virtualenv -p python3 venv
source venv/bin/activate
pip install .

Note: If you don't want to install Xen, vagrant-xen-pyvmidbg provides a Vagrant environment based on KVM, with ready to use Windows and Linux VMs.

Usage

vmidbg <port> <vm> [<process>]

Demo

Debugging cmd.exe in Windows XP

Demo link

  1. starts cmd.exe in Windows XP nested VM in Xen
  2. starts pyvmidbg and target a process named cmd
  3. connects to stub with radare2
  4. set breakpoints on ntdll!NtOpenFile and ntkrnlpa!NtOpenFile
  5. avoid breakpoints from the rest of the system, only hit if cmd.exe is executing

Debugging mspaint.exe in Windows 10

Debugging mspaint.exe

Limitations

  • the VM must have 1 VCPU
  • no steath breakpoints implemented yet (int3 into memory)

References

Maintainers

@Wenzel

Contributing

PRs accepted.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

GNU General Public License v3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].