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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2016-3861 PoC — Android LibUtils 远程代码执行漏洞

Source
Associated Vulnerability
Title:Android LibUtils 远程代码执行漏洞 (CVE-2016-3861)
Description:Android是美国谷歌(Google)公司和开放手持设备联盟(简称OHA)共同开发的一套以Linux为基础的开源操作系统。Libutils是Android的一个底层库。 Android LibUtils中存在远程代码执行漏洞,该漏洞源于程序没有正确处理Unicode字符编码与不同编码宽度的转换。远程攻击者可通过特制的文件利用该漏洞执行任意代码,或造成拒绝服务(基于堆的缓冲区溢出)。以下版本受到影响:Android 4.4.4之前的4.x版本,5.0.2之前的5.0.x版本,5.1.1之前的5.1.x版本
Description
my extended take on Mark Brand's CVE 2016-3861 libutils bug
Readme
# CVE-2016-3861

An extended version of Mark Brand's libutils exploit, from the Google Project Zero blog post: https://googleprojectzero.blogspot.com/2016/09/return-to-libstagefright-exploiting.html

Main differences:
* all of the mp4 files used for exploitation are generated in the browser dynamically
* comes with an 'extra_groom' option as certain AOSP builds in the 5-6 version regions require additional heap grooming

Does this actually work?
* yes, but it only gets PC control, and does nothing further
* I've only provided hard-coded addresses for one AOSP build that worked on a spare Nexus 5 I had lying around
* I've attempted this exploit on other phone models (e.g. Samsung), and the heap groom seems to be way different
* code is old, and comments aren't exactly fantastic

This was my first foray into browser exploits, and I really just wanted to see if I could do it. Really this just ended up being an exercise in learning mp4 parsing and some libmedia internals.
File Snapshot

[4.0K] /data/pocs/9be6367bb0a03c3a96a286cd147d4f729ba95053 ├── [ 912] bn_calc_offsets.py ├── [ 32K] poc.html └── [ 983] README.md 0 directories, 3 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.