36
Session ID: Session Classification: Advanced HTA-T19 Core Security Technologies Federico Muttis BLACKBERRY PWNAGE THE BLUEJAY STRIKES

BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

Session ID:

Session Classification: Advanced

HTA-T19

Core Security Technologies

Federico Muttis

BLACKBERRY PWNAGETHE BLUEJAY STRIKES

Page 3: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

INFO @ THE MEDIA

Page 4: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

INFO @ THE MEDIA

Page 5: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT

► Vulnerable devices (shortened list)

▶ Pearl family ▶ Curve family (< 9350) ▶ Storm family

▶ Tour 9630▶ Style 9670▶ Bold 9650/9700/9780 ▶ Torch 9800

Page 6: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

CVE-2010-4577ARBITRARY READ

Page 7: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CSS Font Face Parsing Type Confusion Vulnerability

CVE-2010-4577 – PROOF OF CONCEPT

http://code.google.com/p/chromium/issues/detail?id=63866

Page 8: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

IEEE 754 DOUBLE PRECISION FLOATING-POINT

Page 9: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CSS Font Face Parsing Type Confusion Vulnerability

CVE-2010-4577 – CRASH ANALYSIS

002ed594 80000000 01718618 chrome_68390000!WTF::StringImpl::create(wchar_t * characters = 0x80000000 "--- memory read error at address 0x80000000 ---", unsigned int length = 0x2cb)+0x24[c:\b\slave\chrome-official\build\src\third_party\webkit\javascriptcore\wtf\text\stringimpl.cpp @ 99] 80000000 41400000 00000454 chrome_68390000!WTF::String::String(wchar_t * characters = 0x80000000 "--- memory read error at address 0x80000000 ---", unsigned int length = 0x41400000)+0x21

Page 10: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CSS Font Face Parsing Type Confusion Vulnerability

CVE-2010-4577 – EXPLOITATION

Address Size

Page 11: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CSS Font Face Parsing Type Confusion Vulnerability

CVE-2010-4577 – EXPLOITATION

Address Size

Page 12: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

A BLUEJAY APPEARS!

Page 13: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► BlueJay’s early problems

DUMPING THE VIRTUAL ADDRESS SPACE

▶ Poor man’s solution

Page 14: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

BLUEJAY AGENT DIAGRAM

Exploit dispatcher

Memory read Pointer Leak Execute code

BlueJay Server & Console

Memory manager

HTML5Spray

HTML5Edit

HTTP PushBlueJay Agent

Page 15: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► BlueJay’s helper – Java BlackBerry App.

DUMPING THE VIRTUAL ADDRESS SPACE

Browser running?

Yes

Reset backlighttimer

Restart browser

No

Page 16: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

DUMPING DEMO

Page 17: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► BlackBerry’s WebKit Browser main() routine

DISASSEMBLING AND SEARCHING FOR OLYMPIA

Page 18: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CVE-2010-4577 – Arbitrary memory read disassembly

DISASSEMBLING AND LOCATING CVE-2010-4577

Page 19: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

BLACKBERRY PROCESS INTERNALS

▶ 0x4 write▶ 0x16 allocexecmem▶ 0x28 shmget▶ 0x2b alloc▶ 0x27 loadlibrary▶ 0x29 shmat▶ 0x2c sem_create▶ 0x2d sem_unlink || sem_close

▶ 0x41 sendto?▶ 0x46 mk"fo?▶ 0x4a unlink▶ 0x4c mkdir▶ 0x5f open▶ 0x61 lock related (#ock/lockf?)▶ 0x67 threads related

▶ Some syscalls (work in progress...)

Page 20: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

CVE-2011-1290CODE EXECUTION

Page 21: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► Webkit Integer Over#ow near 2011

SEARCHING FOR THE VULNERABILITIES

There is a buffer overflow vulnerability that was released in November 2010 but is still present on the BlackBerry. (…). To exploit the vulnerability I have to set up the heap in a specifc way so I can overflow a specific structure on the heap. This structure is the internal representation for a piece of text on a website. The vulnerability is in the handling of the text nodes, so this is a good target to overflow. (…)

Once I have a stable way to organize the heap and reliably overflow the pointer to the functions, we can start testing. The first test attempts to redirect execution to code that already exists on the BlackBerry. Instead of the JavaScript nodeType call returning the value 3, I redirect it to existing code elsewhere that returns 0. Now I can control the execution flow in the browser.

Willem Pinckaers -

Page 22: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CVE-2011-1290 – Integer Over#ow => Heap Over#ow

EXPLOITING CVE-2011-1290

Heap Over#ow

Integer Over#ow

Page 23: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CVE-2011-1290 – Integer Over#ow

DISASSEMBLING AND LOCATING CVE-2011-1290

Page 24: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CVE-2011-1290 – Integer Over#ow

DISASSEMBLING AND LOCATING CVE-2011-1290

Page 25: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CVE-2011-1290 – Integer Over#ow => Heap Over#ow

DISASSEMBLING AND LOCATING CVE-2011-1290

Page 26: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

► CVE-2011-1290 – Integer Over#ow => Heap Over#ow

DISASSEMBLING AND LOCATING CVE-2011-1290

Page 27: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

CHAINING THE EXPLOITS

Page 28: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

EXPLOITATION RECIPE

▶ 1. HTML5-Spray the process’s heap with a repeated pattern

Page 29: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

EXPLOITATION RECIPE

▶ 1. HTML5-Spray the process’s heap with a repeated pattern

▶ 2. Leak a heap pointer using CVE-2011-0195

Pointer to a valid heap address

Page 30: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

EXPLOITATION RECIPE

▶ 1. HTML5-Spray the process’s heap with a repeated pattern

▶ 2. Leak a heap pointer using CVE-2011-0195

▶ 3. Walk between [ptr-128k, ptr+128k] looking for the signature

Pointer to HTML5-Sprayed block

Pointer to a valid heap address

ignature signature signature signature signature signature signat

HTML5-Spray block

Page 31: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

EXPLOITATION RECIPE

▶ 1. HTML5-Spray the process’s heap with a repeated pattern

▶ 2. Leak a heap pointer using CVE-2011-0195

▶ 3. Walk between [ptr-128k, ptr+128k] looking for the signature

sigptr+x sigptr+y shellcode

HTML5-Spray block

▶ 4. HTML5-Spray-Modify to fake a vtable

ignature signature signature signature signature signature signat

Pointer to HTML5-Sprayed block

Page 32: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

EXPLOITATION RECIPE

▶ 1. HTML5-Spray the process’s heap with a repeated pattern

▶ 2. Leak a heap pointer using CVE-2011-0195

▶ 3. Walk between [ptr-128k, ptr+128k] looking for the signature

sigptr+x sigptr+y shellcode

HTML5-Spray block

▶ 4. HTML5-Spray-Modify to fake a vtable▶ 5. Point the code execution exploit to your block▶ 6. Achieve code execution!

Page 33: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

BLUEJAY VS REAL DEVICE

sigptr sigptr shellcode

HTML5-Spray block

Page 34: BLACKBERRY PWNAGE THE BLUEJAY STRIKES · 2020-06-01 · BLACKBERRY DEVICES WITH KNOWN WORKING EXPLOIT Vulnerable devices (shortened list) Pearl family Curve family (< 9350) Storm

BLUEJAY VS SIMULATOR DEMO