不用虚拟机,使用windows调试linux内核

1.安装msys2

https://www.msys2.org/

2.打开msys2 ucrt64安装qemu和gdb还有gef

pacman -S mingw-w64-ucrt-x86_64-qemu

pacman -S gdb

pacman -S binutils

用下面的脚本安装gef

bash 复制代码
#!/usr/bin/env bash

set -e

# check dependencies
if [ ! "$(command -v python3)" ]; then
	echo "GEF requires Python3 installed."
	exit 1
fi

# Backup gdbinit if any
if [ -f "${HOME}/.gdbinit" ]; then
    mv "${HOME}/.gdbinit" "${HOME}/.gdbinit.old"
fi

tag=$(python3  -X utf8 -c 'import urllib.request as r,json as j; x=j.loads(r.urlopen("https://api.github.com/repos/hugsy/gef/tags").read()); print(x[0]["name"])')
python3 -X utf8 -c "import urllib.request as r; x=r.urlopen('https://github.com/hugsy/gef/raw/${tag}/gef.py').read(); print(x.decode('utf-8'))" > ${HOME}/.gef-${tag}.py

if [ -f "${HOME}/.gef-${tag}.py" ]; then
    echo "source ~/.gef-${tag}.py" > ~/.gdbinit
    exit 0
else
    echo "GEF was not properly downloaded"
    exit 2
fi

官方版本里面缺少-X utf8会出错。

3.去github下载一键包,如:

https://github.com/bsauce/kernel-exploit-factory/tree/main/CVE-2017-11176

注意start.sh里面的-enable-kvm要去掉,因为windows不支持。

4.在msys2 ucrt64里面运行start.sh

5.打开另一个窗口,运行gdb_kernel.sh

相关推荐
Han.miracle12 分钟前
JavaEE-- 网络编程 http请求报头
运维·服务器·网络·网络协议·计算机网络·http
lihui_cbdd32 分钟前
幽灵卡顿:Windows 11 “数据正常但系统卡死“ 的深度排查与终极优化指南
windows
鹿鸣天涯35 分钟前
使用VMware Workstation 17虚拟机安装红帽企业版系统RHEL10
linux·运维·服务器
林抒1 小时前
(2025版)MongoDB 8.0.13 版本安装与配置(Windows 版)保姆级教程
windows·mongodb·nosql数据库
杰 .1 小时前
Linux yum_and_apt
linux·服务器
南棱笑笑生1 小时前
20251129给荣品RD-RK3588开发板跑Rockchip的原厂Buildroot【linux-6.1】系统时适配AP6275P的蓝牙BLE
linux·运维·服务器·rockchip
Brown.alexis2 小时前
docker安装redis7
运维·docker·容器
c***21292 小时前
ubuntu 安装 Redis
linux·redis·ubuntu
u***32432 小时前
Mysql官网下载Windows、Linux各个版本
linux·数据库·mysql