Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2019-8781 PoC — Apple macOS Catalina Kernel组件缓冲区错误漏洞

Source
Associated Vulnerability
Title:Apple macOS Catalina Kernel组件缓冲区错误漏洞 (CVE-2019-8781)
Description:Apple macOS Catalina是美国苹果(Apple)公司的一套专为Mac计算机所开发的专用操作系统。Kernel是其中的一个内核组件。 Apple macOS Catalina 10.15之前版本中的Kernel组件存在安全漏洞。攻击者可利用该漏洞以内核权限执行任意代码。
Description
macOS Kernel Exploit for CVE-2019-8781. 
Readme
# macOS-Kernel-Exploit

## DISCLAIMER
You need to know the KASLR slide to use the exploit. Also SMAP needs to be disabled which means that it's not exploitable on Macs after 2015. These limitations make the exploit pretty much unusable for in-the-wild exploitation but still helpful for
security researchers in a controlled lab environment.

This exploit is intended for security research purposes only.

## General
macOS Kernel Exploit for CVE-2019-8781 ~~(currently a 0day. 
I'll add the CVE# once it is published ;) )~~. 

Thanks to @LinusHenze for this cool bug and his support ;P.

## Writeup

Probably coming soon.
If you want to try and exploit it yourself, here are a few things to get you started:

- VM: Download the macOS installer from the appstore and drag the `.app` file into VMWare's `NEW VM` window
- Kernel Debugging setup: http://ddeville.me/2015/08/using-the-vmware-fusion-gdb-stub-for-kernel-debugging-with-lldb
- Have a look at the _kernel_trap function


## Build

I recommend setting the bootargs to: `debug=0x44 kcsuffix=development -v `

:warning: **Note**: SMAP needs to be disabled on macs after 2015 (`-pmap_smap_disable`)

You will need XCODE <= 9.4.1 to build the exploit. (It needs to be 32bit)
Downloading Xcode 9.4.1 Commandline Tools should be enough ;)
Download: https://developer.apple.com/download/more/

```
make
```

## Execution

```
./exploit <KASLR slide>
```

Tested on macOS Mojave: `Darwin Kernel-Mac.local 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/DEVELOPMENT_X86_64 x86_64`

**Demo**:

[![asciicast](https://asciinema.org/a/gtOLsNfxPSwcOOYKUwcH0JFJd.png)](https://asciinema.org/a/gtOLsNfxPSwcOOYKUwcH0JFJd)
File Snapshot

[4.0K] /data/pocs/6e35c2420bacd9f5bc3c18f0c7fecf606f0d0cbb ├── [1.0K] definitions.h ├── [4.6K] exploit.c ├── [ 98] gadgets.c ├── [1.2K] gadgets.h ├── [3.8K] kernel.s ├── [ 277] Makefile └── [1.7K] README.md 0 directories, 7 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.