4 Star 3 Fork 1

Gitee 极速下载 / zombieload

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/IAIK/ZombieLoad
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

ZombieLoad PoC

This repository contains several applications, demonstrating ZombieLoad. For technical information about the bug, refer to the paper:

Proof of Concepts

This repository contains four different proof-of-concept attacks showing ZombieLoad. It also includes four different victim applications to test the leakage in various scenarios.

All demos are tested with an Intel Core i7-8650U, but they should work on any Linux system with any modern Intel Core or Xeon CPU since 2010. We provide three variants for Linux, which we tested on Ubuntu 18.04.1 LTS, and two variants for Windows, which we tested on Windows 10 (1803 build 17134.706).

For best results, we recommend a fast CPU that supports Intel TSX (e.g. nearly any Intel Core i7-5xxx, i7-6xxx, or i7-7xxx).

Building

The PoCs only require GCC and Make (on Linux) or MinGW-w64 (on Windows) to compile.

Building an attacker or a victim is as simple as running make in the folder of the application.

Attacker Variants

The repository contains four different attacker variants.

Variant 1 (Linux only)

Variant 1 is the fastest, easiest and most stable variant for a privileged attacker (i.e., it requires root privileges). Hence, except for testing, this is especially useful for attacks on SGX or for attacks on virtual machines.

Run

For this variant, KASLR and KPTI have to be disabled. This can be achieved by providing nopti nokaslr to the kernel command line. Then, run the attacker on one hyperthread as root: sudo taskset -c 3 ./leak

Variant 2 (Linux and Windows)

Variant 2 is a fast variant which does not require any privileges. However, it only works on CPUs supporting Intel TSX. Variant 2 is the only variant which also works on CPUs which already have hardware mitigations for Meltdown and Foreshadow.

Run

Simply run the attacker on one hyperthread: taskset -c 3 ./leak

Variant 3 (Windows only)

Variant 3 does not require any CPU features or privileges but it only works on Windows.

Run

Run the attacker on one hyperthread: start /affinity 3 .\leak.exe. It takes a while (up to 1 minute) until the leakage starts, as the PoC has to wait for Windows to collect information about the memory used by the PoC. Starting a different program which uses memory (e.g., a browser) sometimes reduces the waiting time.

Variant 4 (Linux only)

Variant 4 is an interesting special subtype of Variant 2 which only works on CPUs supporting both Intel TSX and SGX. This variant abuses abort page semantics when accessing processor reserved memory in non-enclave mode, and hence requires either permissions to create an enclave or root privileges.

Run

The demonstrator for this variant requires read access to Linux's /dev/cpu/CPUNUM/msr and /dev/mem virtual devices. This can be achieved by loading the msr driver, plus a small custom driver to lift Linux's default CONFIG_STRICT_DEVMEM restrictions:

$ sudo modprobe msr
$ cd module && make load

Then, run the attacker on one hyperthread as root: sudo taskset -c 3 ./leak

Victim Applications

All attacker variants can be used to leak data from the following victim applications. All victim applications leak one uppercase letter. Independent of the chosen victim and attacker application, the attacker displays a histogram of leaked values.

An example output is as follows (for the secret letter 'X' loaded by the victim).

A: (   0) 
B: (   0) 
C: (   0) 
D: (   0) 
E: (   1) 
F: (   0) 
G: (   2) 
H: (   0) 
I: (   0) 
J: (   0) 
K: (   0) 
L: (   0) 
M: (   0) 
N: (   0) 
O: (   0) 
P: (  12) 
Q: (   1) 
R: (   1) 
S: (   0) 
T: (   0) 
U: (   2) 
V: (   1) 
W: (   0) 
X: (1303) ############################################################
Y: (   0) 
Z: (   1) 

Userspace Victim (Linux and Windows)

An unprivileged user application which constantly loads the same value from its memory.

Run (Linux)

Simply run the victim on the same physical core but a different hyperthread as the attacker: taskset -c 7 ./secret. You can also provide a secret letter to the victim application as a parameter, e.g., taskset -c 7 ./secret B to access memory containing 'B's. The default secret letter is 'X'.

As soon as the victim is started, there should be a clear signal in the attacker process, i.e., the bar for the leaked letter should get longer.

Run (Windows)

Simply run the victim on the same physical core but a different hyperthread as the attacker: start /affinity 7 .\secret.exe. You can also provide a secret letter to the victim application as a parameter, e.g., start /affinity 7 .\secret.exe B to access memory containing 'B's. The default secret letter is 'X'.

As soon as the victim is started, there should be a clear signal in the attacker process, i.e., the bar for the leaked letter should get longer.

Kernel Victim (Linux only)

A kernel module which constantly loads the letter 'J'.

Run

Before running the victim, the kernel module has to be loaded into the kernel. This is done by running sudo insmod leaky.ko. Then, simply run the victim on the same physical core but a different hyperthread as the attacker: taskset -c 7 ./secret.

As soon as the victim is started, there should be a clear signal in the attacker process, i.e., the bar for the letter 'J' should get longer.

Intel SGX Victim (Linux only)

An Intel SGX enclave which constantly loads the letter 'S'. This victim requires that the SGX driver and SDK are installed.

Run

Simply run the victim on the same physical core but a different hyperthread as the attacker: taskset -c 7 ./secret.

As soon as the victim is started, there should be a clear signal in the attacker process, i.e., the bar for the letter 'S' should get longer.

VM Victim (Linux and Windows)

A virtual machine containing an application which constantly loads the same value from its memory. This victim requires that QEMU is installed, and VT-x is enabled.

Run

Simply run the victim on the same physical core but a different hyperthread as the attacker: taskset -c 7 ./secret.sh. As soon as the virtual machine started, the victim is run using secret X Where X is the secret character. There should be a clear signal in the attacker process, i.e., the bar for the leaked letter should get longer.

Frequently Asked Questions

  • How do I know which core IDs are hyperthreads?

    On Linux, you can run lscpu -e. This gives you a list of logical cores and their corresponding physical core. Cores mapping to the same physical core are hyperthreads. On Windows, you can use the coreinfo tool from Windows Sysinternals.

  • Can I run the PoC in a virtual machine?

    Yes, the PoC also works on virtual machines. However, due to the additional layer introduced by a virtual machine, it might not work as good as on native hardware.

  • It just does not work on my computer, what can I do?

    There can be a lot of different reasons for that. We collected a few things you can try:

    • Ensure that your CPU frequency is at the maximum, and frequency scaling is disabled.
    • If you run it on a mobile device (e.g., a laptop), ensure that it is plugged in to get the best performance.
    • Try to pin the tools to a specific CPU core (e.g. with taskset). Also try different cores and core combinations. Leaking values only works if attacker and victim run on the same physical core.
    • Vary the load on your computer. On some machines it works better if the load is higher, on others it works better if the load is lower.
    • Use a different variant of ZombieLoad. In this repository, we provide 3 different techniques for the attacker.
    • Try to restart the demos and also your computer. Especially after a standby, the timings are broken on some computers.

Warnings

Warning #1: We are providing this code as-is. You are responsible for protecting yourself, your property and data, and others from any risks caused by this code. This code may cause unexpected and undesirable behavior to occur on your machine. This code may not detect the vulnerability on your machine.

Warning #2: If you find that a computer is susceptible to ZombieLoad, you may want to avoid using it as a multi-user system. ZombieLoad breaches the CPU's memory protection. On a machine that is susceptible to ZombieLoad, one process can potentially read all data used by other processes or by the kernel.

Warning #3: This code is only for testing purposes. Do not run it on any productive systems. Do not run it on any system that might be used by another person or entity.

空文件

简介

该项目包含多个应用程序,用来验证英特尔芯片的 ZombieLoad 漏洞 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/mirrors/zombieload.git
git@gitee.com:mirrors/zombieload.git
mirrors
zombieload
zombieload
master

搜索帮助