百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

shadow-box-for-x86

> 编程语言
开源

Shadow-Box:适用于 x86 的轻量级且实用的内核保护程序(在 BlackHat Asia 2017/2018、beVX 2018 和 HITBSecConf 2017 上展示)

197 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Shadow-Box:适用于 x86 的轻量级且实用的内核保护程序(在 BlackHat Asia 2017/2018、beVX 2018 和 HITBSecConf 2017 上展示)

bash
 ███████╗██╗  ██╗ █████╗ ██████╗  ██████╗ ██╗    ██╗      ██████╗  ██████╗ ██╗  ██╗
 ██╔════╝██║  ██║██╔══██╗██╔══██╗██╔═══██╗██║    ██║      ██╔══██╗██╔═══██╗╚██╗██╔╝
 ███████╗███████║███████║██║  ██║██║   ██║██║ █╗ ██║█████╗██████╔╝██║   ██║ ╚███╔╝ 
 ╚════██║██╔══██║██╔══██║██║  ██║██║   ██║██║███╗██║╚════╝██╔══██╗██║   ██║ ██╔██╗ 
 ███████║██║  ██║██║  ██║██████╔╝╚██████╔╝╚███╔███╔╝      ██████╔╝╚██████╔╝██╔╝ ██╗
 ╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝  ╚═════╝  ╚══╝╚══╝       ╚═════╝  ╚═════╝ ╚═╝  ╚═╝
      
                Lightweight Hypervisor-Based Kernel Protector

0. About Gatekeeper

Gatekeeper is based on Shadow-box.

If you find Gatekeeper, go to Gatekeeper branch.


1. Notice

Shadow-box v2 (for ARM) is a next generation of Shadow-box v1 (for x86). If you want to know about Shadow-box for ARM, please visit Shadow-box for ARM project.

Major changes are as followed:

  • Page Table Isolation (PTI) support
  • Sleep mode of Intel Integrated Graphics support

1.1. Presentations and Papers

Shadow-box is a lightweight and practical kernel protector, and it was introduced at security conferences below.

  • Gatekeeper: beVX 2018
  • Black Hat Asia 2018
  • Black Hat Asia 2017 and Black Hat Asia Arsenal 2017
  • HITBSecConf 2017

You can watch the demo videos below.

  • Gatekeeper Demo: It shows that Gatekeeper can detect and prevent local privilege escalation exploits.
  • Shadow-box Demo 1: It shows that rootkits can neutralize kernel protection mechanism.
  • Shadow-box Demo 2: It shows that Shadow-box can prevent kernel from rootkits.

1.2. Contributions

We always welcome your contributions. Issue report, bug fix, new feature implementation, anything is alright. Feel free to send us.

1.3. License

Shadow-box has GPL v2 license.

2. Introduction of Shadow-Box

Shadow-box is a security monitoring framework for operating systems using state-of-the-art virtualization technologies. Shadow-box has a novel architecture inspired by a shadow play. We made Shadow-box from scratch, and it is primarily composed of a lightweight hypervisor and a security monitor.

The lightweight hypervisor, Light-box, efficiently isolates an OS inside a guest machine and projects static and dynamic kernel objects of the guest into the host machine so that our security monitor in the host can investigate the projected images. The security monitor, Shadow-Watcher, places event monitors on static kernel elements and tests security of dynamic kernel elements.

Shadow-box manipulates address translations from the guest physical address to the host physical address in order to exclude unauthorized accesses to the host and the hypervisor spaces. In that way, Shadow-box can properly introspect the guest operating system and mediate all accesses, even when the operating system is compromised.

2.1. Architecture of Shadow-Box

Shadow-box is a lightweight and practical security monitoring framework using virtualization technologies.

We developed a security monitoring framework, Shadow-box that keeps an OS safe by filtering out unauthorized accesses to important kernel elements and defending the integrity of kernel elements periodically. Shadow-box relies upon its two subparts: a lightweight hypervisor and a security monitor. The lightweight hypervisor, Light-box, efficiently isolates an OS inside a guest machine and projects static and dynamic kernel objects of the guest into the host machine, so that our security monitor in the host can investigate the projected images. The security monitor, Shadow-watcher, places event monitors on static kernel elements and tests security of dynamic kernel elements. Running inside the host, it can test the security of the guest without malicious interference even when the guest OS is compromised.

If you want to know more about Shadow-box, please see my presentation and paper at Black Hat Asia 2017 and HITBSecConf 2017.

3. How to Build

3.1. Prepare Kernel Build Environment (Ubuntu 16.04)

Because the Shadow-box protects the code area of the kernel, it conflicts with the runtime kernel patch feature (CONFIG_JUMP_LABEL). Therefore, if your kernel uses the runtime kernel patch feature, you should remove the feature. To remove it, you need to set a kernel build environment, change the kernel options, and install. The process is as follows.

bash
# Prepare kernel source and build environment.
$> apt-get source linux
$> sudo apt-get build-dep linux
$> sudo apt-get install ncurses-dev

# Make new .config file.
$> cd linux-
$> cp /boot/config- .config
$> make menuconfig
# Load the .config file using the "Load" menu and save it to .config using the "Save" menu.

$> sed -i 's/CONFIG_JUMP_LABEL=y/# CONFIG_JUMP_LABEL is not set/g' .config

# Build kernel and modules.
$> make -j8; make modules

# Install kernel and modules.
$> sudo make modules_install
$> sudo make install

3.2. Prepare Shadow-Box and Kernel Symbols

Shadow-box should locate the data structures and functions for kernel integrity verification. These symbols can be found using kallsyms, but all symbols are not exposed to kallsyms. Therefore, Shadow-box uses the System.map file to embed symbols and kernel versions. How to add symbols and kernel versions to Shadow-box is as follows:

bash
# Prepare Shadow-box source.
$> git clone https://github.com/kkamagui/shadow-box-for-x86.git
$> cd shadow-box-for-x86

# Prepare kernel symbols.
$> uname -v
#37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016			 cp /boot/System.map- system.map/"#37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016.map"

3.3. Build Shadow-Box

When the kernel symbol is ready, type "make" command to build the Shadow-box. Then you can find shadow_box.ko in the same directory.

bash
$> make
$> ls
shadow_box.ko shadow_box.h ...

4. How to Use

Shadow-box is loadable kernel module (LKM). So, when you need protection, you can load the shadow-box.ko module into the kernel with the insmod command.

bash
$> sudo insmod shadow-box.ko

After Shadow-box is loaded, you can test the protection mechanisms of Shadow-box using rootkits such as Adore-ng. If you want to watch demo videos, please follow these links, Demo 1 and Demo 2.

Here is the rootkit detection example. If Shadow-box detects rootkits, Shadow-box writes kernel log messages about rootkit attacks.

…

5.Caution

Shadow-box protects kernel code, read-only data, system table, privilege register, etc. from rootkits. So, if you want to use Shadow-box, you should disable some features below.

  • Disable CONFIG_JUMP_LABEL
    • Change kernel config (.config)
  • Disable hibernation and suspend
    • Change system power management setting
  • Disable IRQ remapping for using IOMMU protection feature
    • Insert intremap=off at the end of linux /boot/vmlinuz... line in grub.cfg file

6.Known Issue

Shadow-box has some known issues below.

  • Too many logs in secure world stops the system intermittently.
    • If you want to log massive information, make FIFO like a kfifo and connect normal world and secure world

Acknowledgments

Shadow-box has been used to protect the kernel of Gooroom platform which is an open source project. This work was supported by Institute for Information & communications Technology Promotion (IITP) grant funded by the Korea government (MSIP) (No.R0236-15-1006, Open Source Software Promotion).

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Cbevxblackhathitbsecconfhypervisor

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言