
qilingframework/qilingQiling是一款高级二进制仿真框架,旨在提供跨平台、跨架构的二进制文件仿真能力。它基于Unicorn引擎构建,能够在隔离环境中仿真和沙箱化机器码,支持多种操作系统(Windows、MacOS、Linux、BSD等)和架构(X86、ARM、MIPS等),以及多种可执行文件格式(PE、ELF、MachO等)。Qiling主要用于安全分析、***软件研究、固件仿真、漏洞挖掘等场景,提供丰富的API和工具,便于用户构建定制化的动态分析工具。
Qiling基于Unicorn构建,但两者定位不同:
Qemu用户模式与Qiling都支持跨架构二进制仿真,但存在关键差异:
安装指南详见官方文档。
以下代码展示如何使用Qiling框架在Linux上仿真Windows可执行文件:
pythonfrom qiling import * # 用于仿真EXE的沙箱函数 def my_sandbox(path, rootfs): # 初始化Qiling引擎 ql = Qiling(path, rootfs) # 开始仿真EXE ql.run() if __name__ == "__main__": # 在指定rootfs下执行Windows EXE my_sandbox(["examples/rootfs/x86_windows/bin/x86_hello.exe"], "examples/rootfs/x86_windows")
以下代码展示如何动态补丁Windows ***Me,使其始终显示"Congratulation"对话框:
pythonfrom qiling import * def force_call_dialog_func(ql): # 获取DialogFunc地址 lpDialogFunc = ql.unpack32(ql.mem.read(ql.reg.esp - 0x8, 4)) # 为DialogFunc设置栈内存 ql.stack_push(0) ql.stack_push(1001) ql.stack_push(273) ql.stack_push(0) ql.stack_push(0x0401018) # 强制EIP跳转到DialogFunc ql.reg.eip = lpDialogFunc def my_sandbox(path, rootfs): ql = Qiling(path, rootfs) # NOP掉部分代码 ql.patch(0x004010B5, b'\x90\x90') ql.patch(0x004010CD, b'\x90\x90') ql.patch(0x0040110B, b'\x90\x90') ql.patch(0x00401112, b'\x90\x90') # 在指定地址设置钩子回调 ql.hook_address(force_call_dialog_func, 0x00401016) ql.run() if __name__ == "__main__": my_sandbox(["rootfs/x86_windows/bin/Easy_CrackMe.exe"], "rootfs/x86_windows")
Qiling提供qltool工具,用于快速仿真shellcode和可执行二进制文件。
bash$ ./qltool shellcode --os linux --arch arm --hex -f examples/shellcodes/linarm32_tcp_reverse_shell.hex
bash$ ./qltool run -f examples/rootfs/x8664_linux/bin/x8664_hello --rootfs examples/rootfs/x8664_linux/
bash$ ./qltool run -f examples/rootfs/x8664_linux/bin/x8664_hello --gdb 127.0.0.1:9999 --rootfs examples/rootfs/x8664_linux
bash$ ./qltool run -f examples/rootfs/x8664_efi/bin/TcgPlatformSetupPolicy --rootfs examples/rootfs/x8664_efi --coverage-format drcov --coverage-file TcgPlatformSetupPolicy.cov
bash$ ./qltool run -f examples/rootfs/x86_windows/bin/x86_hello.exe --rootfs examples/rootfs/x86_windows/ --console False --json
更多详情参见官方文档。
本项目基于GPLv2免费软件许可证发布和分发。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务