Giter Club home page Giter Club logo

kheaps's Introduction

K(H)eaps

K(H)eaps is a systematic study on Linux kernel exploit reliability problem. It identifies the unreliability factors during exploitation and investigates how existing stablization techniques mitigate the unreliability factors. Based on the knowledge, it proposes a new stablization technique and combined the new technique with existing techniques to outperform realworld exploits in reliability.

This repository contains the dataset we used in the paper and the platform we built for the reliability evaluation.

Paper

We describe our findings in the full paper

Playing for K(H)eaps: Understanding and Improving Linux Kernel Exploit Reliability

Kyle Zeng*, Yueqi Chen*, Haehyun Cho, Xinyu Xing, Adam Doupé, Yan Shoshitaishvili, and Tiffany Bao

* indicates equal contribution

In Proceedings of USENIX Security Symposium August 2022,

@inproceedings {280034,
title = {Playing for {K(H)eaps}: Understanding and Improving Linux Kernel Exploit Reliability},
booktitle = {31st USENIX Security Symposium (USENIX Security 22)},
year = {2022},
address = {Boston, MA},
url = {https://www.usenix.org/conference/usenixsecurity22/presentation/zeng},
publisher = {USENIX Association},
month = aug,
}

Setup

For the environment setup, we provide a dockerfile to ease the process.

To build the docker image, you need to run the following command in the source code root directory

cd scripts/create-image/ && ./create-image.sh && cd ../..
docker build -t kheap .

The command takes around 10 minutes to finish.

At this point, a docker image called kheap will be created.

Evaluation

The evaluation can be done completely inside the kheap docker image.

To launch a kheap docker container, you should use docker run --privileged -it kheap bash. Note that we need the privileged flag because the experiments are run in QEMU, which requires the access to kvm to speed up the virtual machines.

Then you can use the following command inside the docker container to evaluate all exploits for a specific CVE

cd /kheap/grader && python vuln_tester.py -c <cve_number> -n 5000 -r ./results -C 2 -m 2 -nl

The above command will run exploits for the specific CVE for 5000 times and save the result in results folder under 2CPU+2GB RAM setting

For example, cd /kheap/grader && python vuln_tester.py -c CVE-2010-2959 -n 5000 -r ./results -C 2 -m 2 -nl will start evaluation for CVE-2010-2959.

For detailed usage, please refer to the help message using python vuln_tester.py -h.

When each evaluation finishes, the result will be printed in stdout and also saved in the results folder in json format.

Note that a full-fledge 5000-run experiment for one CVE takes a 48-core machine 4-6 days to finish.

kheaps's People

Contributors

kyle-kyle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kheaps's Issues

fail to launch qemu

root@31bf148a1d04:/kheap/grader# python vuln_tester.py -c CVE-2010-2959 -n 5000 -r ./results -C 2 -m 2 -nl
[VULNTester][INFO]09-16 11:00 start testing poc_cfh_multi_spray_idle...
0%| | 0/5000 [00:00<?, ?it/s]qemu outputqemu output b''b''

[EXPRunner-0][ERROR]09-16 11:00 fail to launch qemu
[EXPRunner-1][ERROR]09-16 11:00 fail to launch qemu
Traceback (most recent call last):
Traceback (most recent call last):
File "/kheap/grader/qemu_runner.py", line 62, in update
File "/kheap/grader/qemu_runner.py", line 62, in update
output = self.kernel.recvuntil(b" login: ", timeout=self.timeout)
output = self.kernel.recvuntil(b" login: ", timeout=self.timeout)
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/tube.py", line 333, in recvuntil
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/tube.py", line 333, in recvuntil
res = self.recv(timeout=self.timeout)
res = self.recv(timeout=self.timeout)
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/tube.py", line 105, in recv
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/tube.py", line 105, in recv
return self._recv(numb, timeout) or b''
return self._recv(numb, timeout) or b''
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/tube.py", line 183, in _recv
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/tube.py", line 183, in _recv
if not self.buffer and not self._fillbuffer(timeout):
if not self.buffer and not self._fillbuffer(timeout):
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/tube.py", line 154, in _fillbuffer
data = self.recv_raw(self.buffer.get_fill_size())
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/tube.py", line 154, in _fillbuffer
data = self.recv_raw(self.buffer.get_fill_size())
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/process.py", line 686, in recv_raw
File "/usr/local/lib/python3.6/dist-packages/pwnlib/tubes/process.py", line 686, in recv_raw
raise EOFError
EOFError
raise EOFError

EOFError

During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
Traceback (most recent call last):
File "/kheap/grader/exp_runner.py", line 164, in setup
File "/kheap/grader/exp_runner.py", line 164, in setup
self.qemu.wait_ready()
self.qemu.wait_ready()
File "/kheap/grader/qemu_runner.py", line 103, in wait_ready
File "/kheap/grader/qemu_runner.py", line 103, in wait_ready
self.update()
self.update()
File "/kheap/grader/qemu_runner.py", line 68, in update
File "/kheap/grader/qemu_runner.py", line 68, in update
raise RuntimeError("fail to launch qemu")
raise RuntimeError("fail to launch qemu")
RuntimeError: fail to launch qemuRuntimeError: fail to launch qemu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.