SlideShare a Scribd company logo
1 of 95
Download to read offline
One bite and all your dreams will come true:
Analyzing and Attacking Apple Kernel Drivers
X(aolon& Ba( & M(n Spar)) Zhen&
1
Xiaolong Bai
Alibaba Security Engineer 
Ph.D. graduated from Tsinghua
University
Published papers on the top 4: S&P,
Usenix Security, CCS, NDSS
Twitter, Weibo, Github: bxl1989
Min (Spark) Zheng
Alibaba Security Expert
Ph.D. graduated from The CUHK
Twitter@SparkZheng
Weibo@ spark
2
1Overview
2New vulns in
Apple drivers
3Obstacles in
analyzing
Apple drivers
3
4Ryuk: a new
static analysis tool
to analyze drivers
5Ryuk-Fuzz:
combine fuzzing
with static analysis
6Conclusions
Overview
4
Every driver is a kernel extension (.kext) sharing the
same space with the kernel

Location of driver binaries:

•On macOS: /System/Library/Extensions

•On iOS: integrated with kernel in kernelcache
5
Userclient: kernel objects for drivers to provide
service to programs in userspace

Userclient is the interface between user-space
applications and devices
6
In order to provide services, userclients need to
implement several callback methods:

• externalMethod: Provide methods that can be called in user-
space

• clientMemoryForType: Share memory with apps in user-
space

• registerNotificationPort: Allow user-space app to register for
notifications

• clientClose: Close connection with user-space app

• …
7
externalMethod(uint32_t selector,  

IOExternalMethodArguments *arguments, 

IOExternalMethodDispatch *dispatch, 

OSObject *target, void *reference);

•Callback to provide methods to userspace program

•selector: to select method in userclient

•arguments: arguments passed to the selected method

•dispatch: a struct representing the method to be called

•target: the target userclient for the method to be called on

•reference: reference to send results back to userspace program
8
Despite of strict sandbox restriction, some userclients are still
be accessible to sandboxed apps on iOS:

•IOHIDLibUserClient

•IOMobileFramebufferUserClient

•IOSurfaceAcceleratorClient

•AppleJPEGDriverUserClient

•IOAccelDevice2, IOAccelSharedUserClient2,
IOAccelCommandQueue2

•AppleKeyStoreUserClient

•IOSurfaceSendRight, IOSurfaceRootUserClient
9
New vulns in Apple drivers
10
Drivers are good targets for exploiting the kernel

•Share the same space with the kernel

•Have kernel privileges

•Some programmed by third-party vendors, not kernel
developer

•Code quality is not guaranteed

Drivers are frequently exploited in attacks against the
kernel, including jailbreaks
11
Previous vulns in drivers used in jailbreaks:

•11 (v0rtex/electra): IOSurfaceRoot (CVE-2017-13861)

•9 (pangu): IOMobileFrameBuffer (CVE-2016-4654)

•8 (TaiG): IOHIDFamily (CVE-2015-5774)

•7 (pangu): AppleKeyStore  (CVE-2014-4407) 

Next, let’s have a look at some new vulns we recently
discovered in Apple drivers!
12
Privilege escalation on macOS 10.13.3
13
This privilege escalation leverages a new Use-After-
Free vulnerability in the driver IOAcceleratorFamily2

•IOAccelDisplayPipeUserClient2::s_transaction_end
All IOAccelDisplayPipeUserClient2 

share the same IOAccelDisplayPipe2
14
This privilege escalation leverages a new Use-After-
Free vulnerability in the driver IOAcceleratorFamily2

•IOAccelDisplayPipe2::transaction_end
IOAccelDisplayPipe2 contains a link list of IOAccelDisplayPipe2Transaction2.
IOAccelDisplayPipe2::transaction_end traverse the link list to find a transaction
And further call IOAccelDisplayPipeTransaction2::set_transaction_args using the found transaction
A link list of transactions in this IOAccelDisplayPipe2
15
This privilege escalation leverages a new Use-After-
Free vulnerability in the driver IOAcceleratorFamily2

•IOAccelDisplayPipeTransaction2::set_transaction_args
mAccelDisplayPipeUserClient2 is a member of IOAccelDisplayPipeTransaction2, 

whose type is IOAccelDisplayPipeUserClient2, 

representing which userclient the transaction belongs to
The userclient that this transaction belongs to
16
This privilege escalation leverages a new Use-After-
Free vulnerability in the driver IOAcceleratorFamily2

•But, mAccelDisplayPipeUserClient2 can be released by
calling IOServiceClose from user space, causing use-
after-free
Userclient can be released from user space
Cause use-after-freee
17
Exploitation of the bug

• Creat 2 IOAccelDisplayPipeUserClient2

• Begin a IOAccelDisplayPipeTransaction2 by userclient1

• Release userclient1

• End the transaction from userclient2 —> use-after-free

The bug is not exploitable now! 

•Reason: different IOAccelDisplayPipeUserClient2 do not
share the same IOAccelDisplayPipe2 now !
18
Besides the above vuln, we also discovered some
other new vulns in Apple drivers

•CVE-2017-7119 

•CVE-2018-4135 

Next, we will show details of these vulns

19
CVE-2017-7119

•Information leakage in IOFirewireFamily

•Caused by uninitialized stack variable

•In IOFireWireUserClient::externalMethod

20
CVE-2017-7119

•In IOFireWireUserClient::isochChannel_Create

21
CVE-2017-7119

•In IOFWUserObjectExporter::addObject

•outHandle should be set with the index of new-added object

•But, when newCapacity reaches 0xFFFE, new object will not
be added and outHandle will not be set
22
CVE-2017-7119

•Recall in IOFireWireUserClient::externalMethod

•outHandle is unintialized and returned to userspace

•Information leak!
23
CVE-2017-7119

•Can be exploited to get kernel slide, defeat kaslr, e.g.
Kernel slide = 0x4ebc0b6-0x8bc0b6 = 0x4600000
Though outChannelHandle is only 32bit, but enough
since the high 32bit is always 0xffffff80 here
24
CVE-2018-4135

•Use-After-Free in IOFirewireFamily driver

•Lack of locking or serialization when using and
releasing a member variable

•Can be exploited to control PC in kernel

25
CVE-2018-4135

•Use-After-Free in IOFirewireFamily driver

•Lack of locking or serialization when using and
releasing a member variable

•In IOFireWireUserClient::externalMethod,
26
CVE-2018-4135

•IOFireWireUserClient::userAsyncCommand_Submit
looks up for a IOFWUserReadCommand and calls its
“submit” method
27
CVE-2018-4135

•In IOFWUserReadCommand::submit
28
CVE-2018-4135

•(a) release fMem, (b) uses fMem (fMem is a member)
29
CVE-2018-4135

Exploit: 

•Create two threads to invoke method on the same
userclient

•One thread release fMem, the other uses it

30
How to exploit Use-After-Free bug in the kernel for
privilege escalation?

Basic flow:

Construct ROP
chain
Trigger release
Heap spray in
kernel
Trigger use
…
Target Object
…
…
Empty Slot
…
…
Fake object with
fake viable
…
…
Fake object with
fake viable
…
PC control
31
A new heap spray method on macOS

•Utilize OSUnserializeXML 

•Set properties of a device
32
A new heap spray method on macOS

•Some drivers keep any properties set by userspace,
e.g., IOHIDEventService

•Pros: the sprayed data can be read; the head of
sprayed data is controllable
33
ROP chain for privilege escalation
Stack Pivot
_current_proc
_proc_ucred
_posix_cred_get
_bzero
_thread_excep+on_return
Get	ptr	to	struct	proc	of	current	process
Get	ucred	from	struct	proc,	i.e.,	process	owner's	iden+ty
Get	ptr	to	struct	cr_posix
Clear	cr_uid,	cr_ruid,	cr_svuid	in	cr_posix	struct
Exit	kernel,	return	to	userspace
34
Stack Pivot: Change current stack, for performing
ROP in an elegant way

•Previous Methods (Unavailable Now)
In tpwn (on 10.10)
In rootsh (on 10.11)
35
Stack Pivot: Change current stack, for performing
ROP in an elegant way

•New Method
Step 1: Control RAX and affect RCX
(Gadget P1)
Step 2: Modify RSP by controlled RCX
(Gadget P2)
36
Layout of gadgets in a ROP chain

•Assume: RAX is controlled and [RAX+0x10] is to be called

•Store address X in RAX, X contains a ROP chain
Addr of Gadget P2
New RSP: X+0x50
Addr of Gadget P1
X
Addr of Gadget “NOP; RET;”
Addr of _current_proc and Gadget “MOV RDI, RAX”
Address of _proc_ucred and Gadget “MOV RDI, RAX”
Address of _posix_cred_get and Gadget “MOV RDI, RAX”
Addr of _bzero
X
X+0x8
Addr of G_thread_exception_return
…
X+0x10, ROP starts from here
X+0x30
X+0x38
X+0x40, start privilege escalation
Content Address
37
Privilege escalation on the macOS 10.13 and 10.13.2

38
Obstacles in analyzing Apple drivers
39
Analyzing macOS and iOS kernel drivers is not easy!

•Drivers are closed-source: binaries are lack of high-level
semantics and variable types are lost

•Drivers are programmed in C++: virtual functions are
widely used but object types are unknown —> the real
function called is unknown

•Symbols are lost in iOS drivers: iOS kernelcache strips
all symbols in drivers

40
What does a driver’s binary look like in IDA pro?

•macOS driver: some symbols are kept

41
What does a driver’s binary look like in IDA pro?

•macOS driver: But! Wrong parameter inference, lack of
variable types, unrecognizable virtual function calls

Wrong parameter inference
Variable types are lost
Virtual function calls are unrecognizable
42
What does a driver’s binary look like in IDA pro?

•iOS driver: symbols are totally lost

43
What does a driver’s binary look like in IDA pro?

•iOS driver: data structure is gone, e.g. this figure should
be the location of a virtual table

44
What does a driver’s binary look like in IDA pro?

•iOS driver: meaningless function names, totally lost
variable types, unrecognized virtual function calls 

Wrong decompile resulteverywhere !
45
What exactly do we want for a binary to be?

•Function (including virtual func) calls are recognizable,
the called functions are known

•Missing symbols are recovered, decompiled code is
understandable… 

Why?

•Knowing the real call target is a prerequisite for inter-
procedure analysis and futher analysis

•Manual review needs meaningful decompiled code
46
What exactly do we want for a binary to be?

•Just like we have the source code

47
Ryuk: a new static analysis tool 

to analyze Apple drivers
48
Ryuk: a new static analysis tool aiming at solving
uncertainties in Apple drivers, for further analyzing
drivers’ security

•Implemented as an IDA pro python script 

*Ryuk: a character in the comics series Death Note, who loves eating apples.
49
Ryuk’s features (functionalities):

•Class recognition: identify classes’ information

•VTable recognition: identify classes’ virtual functions

•Recover function names: only for iOS drivers

•Resolve variable types: resolve and mark variable types

•Add cross references: for members and virtual funcs

•UI support: better UI support for manual review

• Call graph generation: for inter-procedure analysis
50
Class recognition

•Purpose: for variable type inference and further analysis

• Method: depend on RTTI information left in binaries

• Apple drivers are programed in C++ and support a
limited RTTI feature

• __mod_init_func: a section containing initialization
functions to support RTTI

• Analyzing functions in __mod_init_func section, we can
get information of classes (name, size…)
51
Class recognition

• __mod_init_func
macOS
iOS
52
Class recognition

• Functions in __mod_init_func: register class information
macOS
iOS
Class Name
Class Size
53
Class recognition

• Decompiled code of functions in __mod_init_func
macOS
iOS
54
Class recognition

• With identified class names and sizes, we can create
structures to represent these classes in IDA pro
55
VTable recognition

•In C++, virtual functions of a class are organized in a
structure called VTable, which is in __const section 

•In every C++ class, the first member is always a pointer
to this VTable.
Source code
VTable
Decompiled 

code
56
VTable recognition

•Purpose: resolve the real targets of virtual function calls

• Method: on macOS, there are symbols for VTables
Symbols of VTables VTable structure
57
VTable recognition

• Method: on iOS, several steps depending on the
vtable’s specific structure

• Hint: find class’s global metaclass object and further
find VTable
Class’s global metaclass object
VTable start
58
VTable recognition

• iOS Step 1: adjust __const section in IDA pro

• In __const, mark each 8 bytes as a pointer
59
VTable recognition

• iOS Step 2: find address of class’s global metaclass
object in initialization function of __mod_init_func 

• In Apple driver, most C++ classes have a global metaclass
object describing the class’s basic information
Initialization function of __mod_init_func
Address of class’s global metaclass object
60
VTable recognition

• iOS Step 3: check cross references of the global
metaclass object, find the one in const section and
near the VTable
In const section 

and near VTable
61
VTable recognition

• iOS Step 4: found VTable The address of global metalcass object
VTable start found!
62
VTable recognition

• After recognition, create structure in IDA pro standing
for the VTable, each member is pointer to a virtual func

• Set the first member of class structure as a pointer to
this VTable structure
VTable structure Class structure63
Recover function names (only for iOS)

• In drivers, most classes inherit from classes in the
kernel, e.g., IOService, OSObject

• Most classes in the kernel still keep symbols 

• In C++, when a child class inherits from a parent class
and overrides a virtual function, the overriden function
has same name and offset in VTable
A::foo
class A {
public:
virtual void foo();
}
class B: public A {
public:
virtual void foo();
}
…
…
B::foo
…
…
A’s VTable B’s VTable
Same name

Same offset

in VTable
64
Recover function names (only for iOS)

• Only recover the overridden virtual functions in classes
inherited from classes in the kernel

• Not a complete solution, but cover plenty of critical
functions
IOSurfaceRoot’s VTable
(IOSurfaceRoot is inherited from IOSerivce)
IOService’ VTable
IOSurfaceRoot::

getMetaClass
overriden

functions
IOSurfaceRoot::

free
IOSurfaceRoot::

IOSurfaceRoot
65
Recover function names (only for iOS)

• Many function names can be recovered in this way
Original Now
66
Resolve variable types (in IDA pro’s decompiled code)

•For local, global and member variables

•Method: identify variable types and perform type
propagation 

•How to identify variable types: two ways

• 1. Depend on features of function names in C++

• 2. Figure out the creation and iniatialization of variables
67
Resolve variable types (in IDA pro’s decompiled code)

•Identify variable types method 1:

• After compilation, names of functions in C++ classes will
be encoded with the function name and argument types

• Decode (demangle) the C++ function names to get the type
of function arguments, e.g.
__ZN23IOSurfaceRootUserClient4initEP13IOSurfaceRootP4taskP12OSDictionary
IOSurfaceRootUserClient::init (IOSurfaceRoot *, task *, OSDictionary *)
Decode (Demangle)
Variable Types
68
Resolve variable types (in IDA pro’s decompiled code)

•Identify variable types method 2:

• Figure out the creation and iniatialization of variables

• Find invocation of variable allocation, initialization and type
casting functions, e.g.
Allocation Func: OSMetaClass::allocClassWithName (const char *name)

Allocatoin Func: IOSurfaceRootUserClient::MetaClass::alloc ( )

Init Func: IOCommandGate::IOCommandGate (IOCommandGate *)

Type Cast: OSMetaClassBase::safeMetaCast (OSMetaClassBase *, OSMetaClass *)
69
Resolve variable types (in IDA pro’s decompiled code)

•After identifying variable types, we can perform type
propagation along function’s control flow
Type of v2 is IOAccelShared2 *
Type of v2 is IOGraphicsAccelerator2 *
70
Resolve variable types (in IDA pro’s decompiled code)

•After identifying variable types, we can perform type
propagation along function’s control flow
Propagate v2’s type and affect the return type of function
Propagate v2’s type and modify member variable’s type
71
Add cross references:

•Purpose: add cross references for member varaibles
and virtual functions

•Method: examine every sentence in the decompiled
code of all functions, check whether member variable
or virtual function is used, e.g.
72
Add cross references:

•References are added from the usage to members in
the class structures and to virtual function’s
implementation
73
Now, driver’s decompiled code in IDA pro looks like

•Looks more like source code, right?
74
But, for manual review in IDA pro’s decompiled code,
though virtual function calls are recognized and
identified with the help of above features, researchers
still need more manual operation to examine the
function’s implementation. e.g.
Manual operation:
Step 1: Copy name of the called function Step 2: Search the function name
75
UI support 

•Extend UI operation that can be performed in IDA pro’s
decompiled code

•Method:

• Register action to double-click events

• Register action to key events

• Register action to name change events

• Register action to type change events
76
UI support 

•Extend UI operation that can be performed in IDA pro’s
decompiled code, e.g. jump to virtual function’s
implementation by just a double click

•Method:

• Register action to double-click events

• Register action to key events

• Register action to name change events

• Register action to type change events
77
UI support
78
Generate call graph

•For further inter-procedure analysis, call graph is the
prerequisite 

•After variable types are resolved, targets of virtual
function calls can be recognized

•Then we can build call graph for all functions
79
Now, everything is ready, you can do your own
manual analysis and static analysis
80
Ryuk-Fuzz: combine fuzzing 

with static analysis
81
One use case of Ryuk: Ryuk-Fuzz

•Idea: Guide fuzzing of drivers with Ryuk’s static analysis 

•Implementation: Integrate Ryuk with the state-of-art
Apple kernel driver fuzzer, PassiveFuzzFrameworkOSX 

•Method: 

• Step 1: Perform data flow analysis in Ryuk to infer drivers’
required user input formats

• Step 2: During fuzzing, use the inferred input formats to
guide input generation and improve fuzzing efficiency
82
Ryuk-Fuzz Step 1: Static data flow analysis to infer
user input formats
Offset:0 Size: whole
Offset:24 Size: 1
Offset:0 Size: 4
Offset:68 Size: 4
83
Ryuk-Fuzz Step 1: Static data flow analysis to infer
user input formats
Condition: offset 24, size: 1
should not be equal to 6 or 1
Condition: offset 0, size: 4
last 4 bits should not
be equal to 0
84
Ryuk-Fuzz Step 2: Guide fuzzing

•BUT ! PassiveFuzzFrameworkOSX has implementation
errors

•Error 1: Wrong buffer size for reading the kernel header
(affect macOS 10.12 and later)

Error in PassiveFuzzFrameworkOSX
85
Ryuk-Fuzz Step 2: Guide fuzzing

•Error 1: Wrong buffer size for reading the kernel header
(affect macOS 10.12 and later)

PassiveFuzzFrameworkOSX assumes 

kernel header is smaller than a page
86
Ryuk-Fuzz Step 2: Guide fuzzing

•Cause of Error 1: Wrong buffer size for reading the
kernel header (affect macOS 10.12 and later)

Before 10.12
Header size is 

smaller than 1 page
After 10.12
Header size is 

larger than 1 page
87
Ryuk-Fuzz Step 2: Guide fuzzing

•Solution to Error 1: enlarge the allocation size

2 * PAGE_SIZE_64
88
Ryuk-Fuzz Step 2: Guide fuzzing

•Error still exists in PassiveFuzzFrameworkOSX

•Error 2: Wrong way to infer kernel base at runtime 

(affect 10.13.2 and after) 

PassiveFuzzFrameworkOSX calcuate the address of interrupt handler 

and search backwards for mach-o header ( i.e. the kernel base address )
89
Ryuk-Fuzz Step 2: Guide fuzzing

•Cause of Error 2: In current macOS, interrupt handler is
not in kernel text section now. As a result, we can not
find the kernel base by searching backwards from the
interrupt handler 

Kernel text start

(kernel base)
Kernel text section
Address of 

interrupt handler
Before macOS 10.13.2
Kernel text start

(kernel base)
Kernel text section
Address of 

interrupt handler
After macOS 10.13.2
Some other section
90
Ryuk-Fuzz Step 2: Guide fuzzing

•Why the interrupt handler is not in kernel text now?

• The side effect of Apple’s patch to mitigate Meltdown
vulnerability

• Apple splits user and kernel space, in which interrupt
handler entries are not in kernel text space now

• As a result, kernel text base can not be inferred by the
interrupt handler

91
Ryuk-Fuzz Step 2: Guide fuzzing

•Solution to Error 2: Search backwards from the address
of some other address, e.g. address of _lck_mtx_lock

Get the address of _lck_mtx_lock
92
Conclusions
93
Vulnerabilities that can be exploited for privilege
escalation on macOS

Technique of exploiting use-after-free vulnerability in
the kernel

Ryuk: a new static analysis tool assisting manually
reverse engineering and static analysis

Ryuk-Fuzz: guide fuzzing of drivers with static
analysis results
94
95
Q&A

More Related Content

What's hot

Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_CompromisedCansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_CompromisedLiang Chen
 
Ruxcon 2014 - Stefan Esser - iOS8 Containers, Sandboxes and Entitlements
Ruxcon 2014 - Stefan Esser - iOS8 Containers, Sandboxes and EntitlementsRuxcon 2014 - Stefan Esser - iOS8 Containers, Sandboxes and Entitlements
Ruxcon 2014 - Stefan Esser - iOS8 Containers, Sandboxes and EntitlementsStefan Esser
 
Targeting the iOS kernel
Targeting the iOS kernelTargeting the iOS kernel
Targeting the iOS kernelSeguridad Apple
 
iOS Application Security
iOS Application SecurityiOS Application Security
iOS Application SecurityEgor Tolstoy
 
iOS Application Penetation Test
iOS Application Penetation TestiOS Application Penetation Test
iOS Application Penetation TestJongWon Kim
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationAndreas Kurtz
 
Csw2016 macaulay eh_trace-rop_hooks
Csw2016 macaulay eh_trace-rop_hooksCsw2016 macaulay eh_trace-rop_hooks
Csw2016 macaulay eh_trace-rop_hooksCanSecWest
 
Dark Side of iOS [SmartDevCon 2013]
Dark Side of iOS [SmartDevCon 2013]Dark Side of iOS [SmartDevCon 2013]
Dark Side of iOS [SmartDevCon 2013]Kuba Břečka
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersRyanISI
 
open source nn frameworks on cellphones
open source nn frameworks on cellphonesopen source nn frameworks on cellphones
open source nn frameworks on cellphonesKoan-Sin Tan
 
Avoid loss of hair while coding Unity3D plugins for mobile
Avoid loss of hair while coding Unity3D plugins for mobileAvoid loss of hair while coding Unity3D plugins for mobile
Avoid loss of hair while coding Unity3D plugins for mobileCodemotion
 
Ci for i-os-codemash-01.2013
Ci for i-os-codemash-01.2013Ci for i-os-codemash-01.2013
Ci for i-os-codemash-01.2013Kevin Munc
 
iOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic TechniquesiOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic TechniquesÖmer Coşkun
 
Toorcon 2010: IPhone Rootkits? There's an App for That
Toorcon 2010: IPhone Rootkits? There's an App for ThatToorcon 2010: IPhone Rootkits? There's an App for That
Toorcon 2010: IPhone Rootkits? There's an App for ThatEric Monti
 
OWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration TestingOWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration Testingeightbit
 
Software Security : From school to reality and back!
Software Security : From school to reality and back!Software Security : From school to reality and back!
Software Security : From school to reality and back!Peter Hlavaty
 

What's hot (20)

Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_CompromisedCansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
 
Ruxcon 2014 - Stefan Esser - iOS8 Containers, Sandboxes and Entitlements
Ruxcon 2014 - Stefan Esser - iOS8 Containers, Sandboxes and EntitlementsRuxcon 2014 - Stefan Esser - iOS8 Containers, Sandboxes and Entitlements
Ruxcon 2014 - Stefan Esser - iOS8 Containers, Sandboxes and Entitlements
 
Targeting the iOS kernel
Targeting the iOS kernelTargeting the iOS kernel
Targeting the iOS kernel
 
iOS Application Security
iOS Application SecurityiOS Application Security
iOS Application Security
 
iOS Application Penetation Test
iOS Application Penetation TestiOS Application Penetation Test
iOS Application Penetation Test
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
 
iOS Application Exploitation
iOS Application ExploitationiOS Application Exploitation
iOS Application Exploitation
 
Csw2016 macaulay eh_trace-rop_hooks
Csw2016 macaulay eh_trace-rop_hooksCsw2016 macaulay eh_trace-rop_hooks
Csw2016 macaulay eh_trace-rop_hooks
 
Dark Side of iOS [SmartDevCon 2013]
Dark Side of iOS [SmartDevCon 2013]Dark Side of iOS [SmartDevCon 2013]
Dark Side of iOS [SmartDevCon 2013]
 
Caffe2 on Android
Caffe2 on AndroidCaffe2 on Android
Caffe2 on Android
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for Beginners
 
open source nn frameworks on cellphones
open source nn frameworks on cellphonesopen source nn frameworks on cellphones
open source nn frameworks on cellphones
 
Avoid loss of hair while coding Unity3D plugins for mobile
Avoid loss of hair while coding Unity3D plugins for mobileAvoid loss of hair while coding Unity3D plugins for mobile
Avoid loss of hair while coding Unity3D plugins for mobile
 
Ci for i-os-codemash-01.2013
Ci for i-os-codemash-01.2013Ci for i-os-codemash-01.2013
Ci for i-os-codemash-01.2013
 
iOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic TechniquesiOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic Techniques
 
Breaking iOS Apps using Cycript
Breaking iOS Apps using CycriptBreaking iOS Apps using Cycript
Breaking iOS Apps using Cycript
 
Toorcon 2010: IPhone Rootkits? There's an App for That
Toorcon 2010: IPhone Rootkits? There's an App for ThatToorcon 2010: IPhone Rootkits? There's an App for That
Toorcon 2010: IPhone Rootkits? There's an App for That
 
OWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration TestingOWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration Testing
 
Pentesting iOS Apps
Pentesting iOS AppsPentesting iOS Apps
Pentesting iOS Apps
 
Software Security : From school to reality and back!
Software Security : From school to reality and back!Software Security : From school to reality and back!
Software Security : From school to reality and back!
 

Similar to One bite and all your dreams will come true: Analyzing and Attacking Apple Kernel Drivers

NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNoSuchCon
 
Windows内核技术介绍
Windows内核技术介绍Windows内核技术介绍
Windows内核技术介绍jeffz
 
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...44CON
 
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them allEclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them allMarc Dutoo
 
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open WideOCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open WideOCCIware
 
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Anne Nicolas
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitDimitry Snezhkov
 
OpenERP Technical Memento
OpenERP Technical MementoOpenERP Technical Memento
OpenERP Technical MementoOdoo
 
Bash-ing brittle indicators: Red teaming mac-os without bash or python
Bash-ing brittle indicators: Red teaming mac-os without bash or pythonBash-ing brittle indicators: Red teaming mac-os without bash or python
Bash-ing brittle indicators: Red teaming mac-os without bash or pythonCody Thomas
 
openioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsopenioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsTakahiro Haruyama
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteTushar B Kute
 
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...Liang Chen
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangLyon Yang
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsenSilo
 
Piratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPriyanka Aash
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4openerpwiki
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOpsMatt Ray
 

Similar to One bite and all your dreams will come true: Analyzing and Attacking Apple Kernel Drivers (20)

NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
 
Windows内核技术介绍
Windows内核技术介绍Windows内核技术介绍
Windows内核技术介绍
 
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
 
Attack on the Core
Attack on the CoreAttack on the Core
Attack on the Core
 
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them allEclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
 
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open WideOCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
 
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
 
OpenERP Technical Memento
OpenERP Technical MementoOpenERP Technical Memento
OpenERP Technical Memento
 
Bash-ing brittle indicators: Red teaming mac-os without bash or python
Bash-ing brittle indicators: Red teaming mac-os without bash or pythonBash-ing brittle indicators: Red teaming mac-os without bash or python
Bash-ing brittle indicators: Red teaming mac-os without bash or python
 
openioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsopenioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensics
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
MattsonTutorialSC14.pdf
MattsonTutorialSC14.pdfMattsonTutorialSC14.pdf
MattsonTutorialSC14.pdf
 
Eusecwest
EusecwestEusecwest
Eusecwest
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
 
Piratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigation
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOps
 

More from Priyanka Aash

Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOsPriyanka Aash
 
Verizon Breach Investigation Report (VBIR).pdf
Verizon Breach Investigation Report (VBIR).pdfVerizon Breach Investigation Report (VBIR).pdf
Verizon Breach Investigation Report (VBIR).pdfPriyanka Aash
 
Top 10 Security Risks .pptx.pdf
Top 10 Security Risks .pptx.pdfTop 10 Security Risks .pptx.pdf
Top 10 Security Risks .pptx.pdfPriyanka Aash
 
Simplifying data privacy and protection.pdf
Simplifying data privacy and protection.pdfSimplifying data privacy and protection.pdf
Simplifying data privacy and protection.pdfPriyanka Aash
 
Generative AI and Security (1).pptx.pdf
Generative AI and Security (1).pptx.pdfGenerative AI and Security (1).pptx.pdf
Generative AI and Security (1).pptx.pdfPriyanka Aash
 
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdf
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdfEVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdf
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdfPriyanka Aash
 
Cyber Truths_Are you Prepared version 1.1.pptx.pdf
Cyber Truths_Are you Prepared version 1.1.pptx.pdfCyber Truths_Are you Prepared version 1.1.pptx.pdf
Cyber Truths_Are you Prepared version 1.1.pptx.pdfPriyanka Aash
 
Cyber Crisis Management.pdf
Cyber Crisis Management.pdfCyber Crisis Management.pdf
Cyber Crisis Management.pdfPriyanka Aash
 
CISOPlatform journey.pptx.pdf
CISOPlatform journey.pptx.pdfCISOPlatform journey.pptx.pdf
CISOPlatform journey.pptx.pdfPriyanka Aash
 
Chennai Chapter.pptx.pdf
Chennai Chapter.pptx.pdfChennai Chapter.pptx.pdf
Chennai Chapter.pptx.pdfPriyanka Aash
 
Cloud attack vectors_Moshe.pdf
Cloud attack vectors_Moshe.pdfCloud attack vectors_Moshe.pdf
Cloud attack vectors_Moshe.pdfPriyanka Aash
 
Stories From The Web 3 Battlefield
Stories From The Web 3 BattlefieldStories From The Web 3 Battlefield
Stories From The Web 3 BattlefieldPriyanka Aash
 
Lessons Learned From Ransomware Attacks
Lessons Learned From Ransomware AttacksLessons Learned From Ransomware Attacks
Lessons Learned From Ransomware AttacksPriyanka Aash
 
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)Emerging New Threats And Top CISO Priorities In 2022 (Chennai)
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)Priyanka Aash
 
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)Priyanka Aash
 
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)Priyanka Aash
 
Cloud Security: Limitations of Cloud Security Groups and Flow Logs
Cloud Security: Limitations of Cloud Security Groups and Flow LogsCloud Security: Limitations of Cloud Security Groups and Flow Logs
Cloud Security: Limitations of Cloud Security Groups and Flow LogsPriyanka Aash
 
Cyber Security Governance
Cyber Security GovernanceCyber Security Governance
Cyber Security GovernancePriyanka Aash
 

More from Priyanka Aash (20)

Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
 
Verizon Breach Investigation Report (VBIR).pdf
Verizon Breach Investigation Report (VBIR).pdfVerizon Breach Investigation Report (VBIR).pdf
Verizon Breach Investigation Report (VBIR).pdf
 
Top 10 Security Risks .pptx.pdf
Top 10 Security Risks .pptx.pdfTop 10 Security Risks .pptx.pdf
Top 10 Security Risks .pptx.pdf
 
Simplifying data privacy and protection.pdf
Simplifying data privacy and protection.pdfSimplifying data privacy and protection.pdf
Simplifying data privacy and protection.pdf
 
Generative AI and Security (1).pptx.pdf
Generative AI and Security (1).pptx.pdfGenerative AI and Security (1).pptx.pdf
Generative AI and Security (1).pptx.pdf
 
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdf
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdfEVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdf
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdf
 
DPDP Act 2023.pdf
DPDP Act 2023.pdfDPDP Act 2023.pdf
DPDP Act 2023.pdf
 
Cyber Truths_Are you Prepared version 1.1.pptx.pdf
Cyber Truths_Are you Prepared version 1.1.pptx.pdfCyber Truths_Are you Prepared version 1.1.pptx.pdf
Cyber Truths_Are you Prepared version 1.1.pptx.pdf
 
Cyber Crisis Management.pdf
Cyber Crisis Management.pdfCyber Crisis Management.pdf
Cyber Crisis Management.pdf
 
CISOPlatform journey.pptx.pdf
CISOPlatform journey.pptx.pdfCISOPlatform journey.pptx.pdf
CISOPlatform journey.pptx.pdf
 
Chennai Chapter.pptx.pdf
Chennai Chapter.pptx.pdfChennai Chapter.pptx.pdf
Chennai Chapter.pptx.pdf
 
Cloud attack vectors_Moshe.pdf
Cloud attack vectors_Moshe.pdfCloud attack vectors_Moshe.pdf
Cloud attack vectors_Moshe.pdf
 
Stories From The Web 3 Battlefield
Stories From The Web 3 BattlefieldStories From The Web 3 Battlefield
Stories From The Web 3 Battlefield
 
Lessons Learned From Ransomware Attacks
Lessons Learned From Ransomware AttacksLessons Learned From Ransomware Attacks
Lessons Learned From Ransomware Attacks
 
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)Emerging New Threats And Top CISO Priorities In 2022 (Chennai)
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)
 
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)
 
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)
 
Cloud Security: Limitations of Cloud Security Groups and Flow Logs
Cloud Security: Limitations of Cloud Security Groups and Flow LogsCloud Security: Limitations of Cloud Security Groups and Flow Logs
Cloud Security: Limitations of Cloud Security Groups and Flow Logs
 
Cyber Security Governance
Cyber Security GovernanceCyber Security Governance
Cyber Security Governance
 
Ethical Hacking
Ethical HackingEthical Hacking
Ethical Hacking
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 

One bite and all your dreams will come true: Analyzing and Attacking Apple Kernel Drivers

  • 1. One bite and all your dreams will come true: Analyzing and Attacking Apple Kernel Drivers X(aolon& Ba( & M(n Spar)) Zhen& 1
  • 2. Xiaolong Bai Alibaba Security Engineer  Ph.D. graduated from Tsinghua University Published papers on the top 4: S&P, Usenix Security, CCS, NDSS Twitter, Weibo, Github: bxl1989 Min (Spark) Zheng Alibaba Security Expert Ph.D. graduated from The CUHK Twitter@SparkZheng Weibo@ spark 2
  • 3. 1Overview 2New vulns in Apple drivers 3Obstacles in analyzing Apple drivers 3 4Ryuk: a new static analysis tool to analyze drivers 5Ryuk-Fuzz: combine fuzzing with static analysis 6Conclusions
  • 5. Every driver is a kernel extension (.kext) sharing the same space with the kernel Location of driver binaries: •On macOS: /System/Library/Extensions •On iOS: integrated with kernel in kernelcache 5
  • 6. Userclient: kernel objects for drivers to provide service to programs in userspace Userclient is the interface between user-space applications and devices 6
  • 7. In order to provide services, userclients need to implement several callback methods: • externalMethod: Provide methods that can be called in user- space • clientMemoryForType: Share memory with apps in user- space • registerNotificationPort: Allow user-space app to register for notifications • clientClose: Close connection with user-space app • … 7
  • 8. externalMethod(uint32_t selector,  
 IOExternalMethodArguments *arguments, 
 IOExternalMethodDispatch *dispatch, 
 OSObject *target, void *reference); •Callback to provide methods to userspace program •selector: to select method in userclient •arguments: arguments passed to the selected method •dispatch: a struct representing the method to be called •target: the target userclient for the method to be called on •reference: reference to send results back to userspace program 8
  • 9. Despite of strict sandbox restriction, some userclients are still be accessible to sandboxed apps on iOS: •IOHIDLibUserClient •IOMobileFramebufferUserClient •IOSurfaceAcceleratorClient •AppleJPEGDriverUserClient •IOAccelDevice2, IOAccelSharedUserClient2, IOAccelCommandQueue2 •AppleKeyStoreUserClient •IOSurfaceSendRight, IOSurfaceRootUserClient 9
  • 10. New vulns in Apple drivers 10
  • 11. Drivers are good targets for exploiting the kernel •Share the same space with the kernel •Have kernel privileges •Some programmed by third-party vendors, not kernel developer •Code quality is not guaranteed Drivers are frequently exploited in attacks against the kernel, including jailbreaks 11
  • 12. Previous vulns in drivers used in jailbreaks: •11 (v0rtex/electra): IOSurfaceRoot (CVE-2017-13861) •9 (pangu): IOMobileFrameBuffer (CVE-2016-4654) •8 (TaiG): IOHIDFamily (CVE-2015-5774) •7 (pangu): AppleKeyStore  (CVE-2014-4407)  Next, let’s have a look at some new vulns we recently discovered in Apple drivers! 12
  • 13. Privilege escalation on macOS 10.13.3 13
  • 14. This privilege escalation leverages a new Use-After- Free vulnerability in the driver IOAcceleratorFamily2 •IOAccelDisplayPipeUserClient2::s_transaction_end All IOAccelDisplayPipeUserClient2 
 share the same IOAccelDisplayPipe2 14
  • 15. This privilege escalation leverages a new Use-After- Free vulnerability in the driver IOAcceleratorFamily2 •IOAccelDisplayPipe2::transaction_end IOAccelDisplayPipe2 contains a link list of IOAccelDisplayPipe2Transaction2. IOAccelDisplayPipe2::transaction_end traverse the link list to find a transaction And further call IOAccelDisplayPipeTransaction2::set_transaction_args using the found transaction A link list of transactions in this IOAccelDisplayPipe2 15
  • 16. This privilege escalation leverages a new Use-After- Free vulnerability in the driver IOAcceleratorFamily2 •IOAccelDisplayPipeTransaction2::set_transaction_args mAccelDisplayPipeUserClient2 is a member of IOAccelDisplayPipeTransaction2, 
 whose type is IOAccelDisplayPipeUserClient2, 
 representing which userclient the transaction belongs to The userclient that this transaction belongs to 16
  • 17. This privilege escalation leverages a new Use-After- Free vulnerability in the driver IOAcceleratorFamily2 •But, mAccelDisplayPipeUserClient2 can be released by calling IOServiceClose from user space, causing use- after-free Userclient can be released from user space Cause use-after-freee 17
  • 18. Exploitation of the bug • Creat 2 IOAccelDisplayPipeUserClient2 • Begin a IOAccelDisplayPipeTransaction2 by userclient1 • Release userclient1 • End the transaction from userclient2 —> use-after-free The bug is not exploitable now! •Reason: different IOAccelDisplayPipeUserClient2 do not share the same IOAccelDisplayPipe2 now ! 18
  • 19. Besides the above vuln, we also discovered some other new vulns in Apple drivers •CVE-2017-7119 •CVE-2018-4135 Next, we will show details of these vulns 19
  • 20. CVE-2017-7119 •Information leakage in IOFirewireFamily •Caused by uninitialized stack variable •In IOFireWireUserClient::externalMethod 20
  • 22. CVE-2017-7119 •In IOFWUserObjectExporter::addObject •outHandle should be set with the index of new-added object •But, when newCapacity reaches 0xFFFE, new object will not be added and outHandle will not be set 22
  • 23. CVE-2017-7119 •Recall in IOFireWireUserClient::externalMethod •outHandle is unintialized and returned to userspace •Information leak! 23
  • 24. CVE-2017-7119 •Can be exploited to get kernel slide, defeat kaslr, e.g. Kernel slide = 0x4ebc0b6-0x8bc0b6 = 0x4600000 Though outChannelHandle is only 32bit, but enough since the high 32bit is always 0xffffff80 here 24
  • 25. CVE-2018-4135 •Use-After-Free in IOFirewireFamily driver •Lack of locking or serialization when using and releasing a member variable •Can be exploited to control PC in kernel 25
  • 26. CVE-2018-4135 •Use-After-Free in IOFirewireFamily driver •Lack of locking or serialization when using and releasing a member variable •In IOFireWireUserClient::externalMethod, 26
  • 27. CVE-2018-4135 •IOFireWireUserClient::userAsyncCommand_Submit looks up for a IOFWUserReadCommand and calls its “submit” method 27
  • 29. CVE-2018-4135 •(a) release fMem, (b) uses fMem (fMem is a member) 29
  • 30. CVE-2018-4135 Exploit: •Create two threads to invoke method on the same userclient •One thread release fMem, the other uses it 30
  • 31. How to exploit Use-After-Free bug in the kernel for privilege escalation? Basic flow: Construct ROP chain Trigger release Heap spray in kernel Trigger use … Target Object … … Empty Slot … … Fake object with fake viable … … Fake object with fake viable … PC control 31
  • 32. A new heap spray method on macOS •Utilize OSUnserializeXML •Set properties of a device 32
  • 33. A new heap spray method on macOS •Some drivers keep any properties set by userspace, e.g., IOHIDEventService •Pros: the sprayed data can be read; the head of sprayed data is controllable 33
  • 34. ROP chain for privilege escalation Stack Pivot _current_proc _proc_ucred _posix_cred_get _bzero _thread_excep+on_return Get ptr to struct proc of current process Get ucred from struct proc, i.e., process owner's iden+ty Get ptr to struct cr_posix Clear cr_uid, cr_ruid, cr_svuid in cr_posix struct Exit kernel, return to userspace 34
  • 35. Stack Pivot: Change current stack, for performing ROP in an elegant way •Previous Methods (Unavailable Now) In tpwn (on 10.10) In rootsh (on 10.11) 35
  • 36. Stack Pivot: Change current stack, for performing ROP in an elegant way •New Method Step 1: Control RAX and affect RCX (Gadget P1) Step 2: Modify RSP by controlled RCX (Gadget P2) 36
  • 37. Layout of gadgets in a ROP chain •Assume: RAX is controlled and [RAX+0x10] is to be called •Store address X in RAX, X contains a ROP chain Addr of Gadget P2 New RSP: X+0x50 Addr of Gadget P1 X Addr of Gadget “NOP; RET;” Addr of _current_proc and Gadget “MOV RDI, RAX” Address of _proc_ucred and Gadget “MOV RDI, RAX” Address of _posix_cred_get and Gadget “MOV RDI, RAX” Addr of _bzero X X+0x8 Addr of G_thread_exception_return … X+0x10, ROP starts from here X+0x30 X+0x38 X+0x40, start privilege escalation Content Address 37
  • 38. Privilege escalation on the macOS 10.13 and 10.13.2 38
  • 39. Obstacles in analyzing Apple drivers 39
  • 40. Analyzing macOS and iOS kernel drivers is not easy! •Drivers are closed-source: binaries are lack of high-level semantics and variable types are lost •Drivers are programmed in C++: virtual functions are widely used but object types are unknown —> the real function called is unknown •Symbols are lost in iOS drivers: iOS kernelcache strips all symbols in drivers 40
  • 41. What does a driver’s binary look like in IDA pro? •macOS driver: some symbols are kept 41
  • 42. What does a driver’s binary look like in IDA pro? •macOS driver: But! Wrong parameter inference, lack of variable types, unrecognizable virtual function calls Wrong parameter inference Variable types are lost Virtual function calls are unrecognizable 42
  • 43. What does a driver’s binary look like in IDA pro? •iOS driver: symbols are totally lost 43
  • 44. What does a driver’s binary look like in IDA pro? •iOS driver: data structure is gone, e.g. this figure should be the location of a virtual table 44
  • 45. What does a driver’s binary look like in IDA pro? •iOS driver: meaningless function names, totally lost variable types, unrecognized virtual function calls Wrong decompile resulteverywhere ! 45
  • 46. What exactly do we want for a binary to be? •Function (including virtual func) calls are recognizable, the called functions are known •Missing symbols are recovered, decompiled code is understandable… Why? •Knowing the real call target is a prerequisite for inter- procedure analysis and futher analysis •Manual review needs meaningful decompiled code 46
  • 47. What exactly do we want for a binary to be? •Just like we have the source code 47
  • 48. Ryuk: a new static analysis tool 
 to analyze Apple drivers 48
  • 49. Ryuk: a new static analysis tool aiming at solving uncertainties in Apple drivers, for further analyzing drivers’ security •Implemented as an IDA pro python script *Ryuk: a character in the comics series Death Note, who loves eating apples. 49
  • 50. Ryuk’s features (functionalities): •Class recognition: identify classes’ information •VTable recognition: identify classes’ virtual functions •Recover function names: only for iOS drivers •Resolve variable types: resolve and mark variable types •Add cross references: for members and virtual funcs •UI support: better UI support for manual review • Call graph generation: for inter-procedure analysis 50
  • 51. Class recognition •Purpose: for variable type inference and further analysis • Method: depend on RTTI information left in binaries • Apple drivers are programed in C++ and support a limited RTTI feature • __mod_init_func: a section containing initialization functions to support RTTI • Analyzing functions in __mod_init_func section, we can get information of classes (name, size…) 51
  • 53. Class recognition • Functions in __mod_init_func: register class information macOS iOS Class Name Class Size 53
  • 54. Class recognition • Decompiled code of functions in __mod_init_func macOS iOS 54
  • 55. Class recognition • With identified class names and sizes, we can create structures to represent these classes in IDA pro 55
  • 56. VTable recognition •In C++, virtual functions of a class are organized in a structure called VTable, which is in __const section •In every C++ class, the first member is always a pointer to this VTable. Source code VTable Decompiled 
 code 56
  • 57. VTable recognition •Purpose: resolve the real targets of virtual function calls • Method: on macOS, there are symbols for VTables Symbols of VTables VTable structure 57
  • 58. VTable recognition • Method: on iOS, several steps depending on the vtable’s specific structure • Hint: find class’s global metaclass object and further find VTable Class’s global metaclass object VTable start 58
  • 59. VTable recognition • iOS Step 1: adjust __const section in IDA pro • In __const, mark each 8 bytes as a pointer 59
  • 60. VTable recognition • iOS Step 2: find address of class’s global metaclass object in initialization function of __mod_init_func • In Apple driver, most C++ classes have a global metaclass object describing the class’s basic information Initialization function of __mod_init_func Address of class’s global metaclass object 60
  • 61. VTable recognition • iOS Step 3: check cross references of the global metaclass object, find the one in const section and near the VTable In const section 
 and near VTable 61
  • 62. VTable recognition • iOS Step 4: found VTable The address of global metalcass object VTable start found! 62
  • 63. VTable recognition • After recognition, create structure in IDA pro standing for the VTable, each member is pointer to a virtual func • Set the first member of class structure as a pointer to this VTable structure VTable structure Class structure63
  • 64. Recover function names (only for iOS) • In drivers, most classes inherit from classes in the kernel, e.g., IOService, OSObject • Most classes in the kernel still keep symbols • In C++, when a child class inherits from a parent class and overrides a virtual function, the overriden function has same name and offset in VTable A::foo class A { public: virtual void foo(); } class B: public A { public: virtual void foo(); } … … B::foo … … A’s VTable B’s VTable Same name
 Same offset
 in VTable 64
  • 65. Recover function names (only for iOS) • Only recover the overridden virtual functions in classes inherited from classes in the kernel • Not a complete solution, but cover plenty of critical functions IOSurfaceRoot’s VTable (IOSurfaceRoot is inherited from IOSerivce) IOService’ VTable IOSurfaceRoot::
 getMetaClass overriden
 functions IOSurfaceRoot::
 free IOSurfaceRoot::
 IOSurfaceRoot 65
  • 66. Recover function names (only for iOS) • Many function names can be recovered in this way Original Now 66
  • 67. Resolve variable types (in IDA pro’s decompiled code) •For local, global and member variables •Method: identify variable types and perform type propagation •How to identify variable types: two ways • 1. Depend on features of function names in C++ • 2. Figure out the creation and iniatialization of variables 67
  • 68. Resolve variable types (in IDA pro’s decompiled code) •Identify variable types method 1: • After compilation, names of functions in C++ classes will be encoded with the function name and argument types • Decode (demangle) the C++ function names to get the type of function arguments, e.g. __ZN23IOSurfaceRootUserClient4initEP13IOSurfaceRootP4taskP12OSDictionary IOSurfaceRootUserClient::init (IOSurfaceRoot *, task *, OSDictionary *) Decode (Demangle) Variable Types 68
  • 69. Resolve variable types (in IDA pro’s decompiled code) •Identify variable types method 2: • Figure out the creation and iniatialization of variables • Find invocation of variable allocation, initialization and type casting functions, e.g. Allocation Func: OSMetaClass::allocClassWithName (const char *name) Allocatoin Func: IOSurfaceRootUserClient::MetaClass::alloc ( ) Init Func: IOCommandGate::IOCommandGate (IOCommandGate *) Type Cast: OSMetaClassBase::safeMetaCast (OSMetaClassBase *, OSMetaClass *) 69
  • 70. Resolve variable types (in IDA pro’s decompiled code) •After identifying variable types, we can perform type propagation along function’s control flow Type of v2 is IOAccelShared2 * Type of v2 is IOGraphicsAccelerator2 * 70
  • 71. Resolve variable types (in IDA pro’s decompiled code) •After identifying variable types, we can perform type propagation along function’s control flow Propagate v2’s type and affect the return type of function Propagate v2’s type and modify member variable’s type 71
  • 72. Add cross references: •Purpose: add cross references for member varaibles and virtual functions •Method: examine every sentence in the decompiled code of all functions, check whether member variable or virtual function is used, e.g. 72
  • 73. Add cross references: •References are added from the usage to members in the class structures and to virtual function’s implementation 73
  • 74. Now, driver’s decompiled code in IDA pro looks like •Looks more like source code, right? 74
  • 75. But, for manual review in IDA pro’s decompiled code, though virtual function calls are recognized and identified with the help of above features, researchers still need more manual operation to examine the function’s implementation. e.g. Manual operation: Step 1: Copy name of the called function Step 2: Search the function name 75
  • 76. UI support •Extend UI operation that can be performed in IDA pro’s decompiled code •Method: • Register action to double-click events • Register action to key events • Register action to name change events • Register action to type change events 76
  • 77. UI support •Extend UI operation that can be performed in IDA pro’s decompiled code, e.g. jump to virtual function’s implementation by just a double click •Method: • Register action to double-click events • Register action to key events • Register action to name change events • Register action to type change events 77
  • 79. Generate call graph •For further inter-procedure analysis, call graph is the prerequisite •After variable types are resolved, targets of virtual function calls can be recognized •Then we can build call graph for all functions 79
  • 80. Now, everything is ready, you can do your own manual analysis and static analysis 80
  • 81. Ryuk-Fuzz: combine fuzzing 
 with static analysis 81
  • 82. One use case of Ryuk: Ryuk-Fuzz •Idea: Guide fuzzing of drivers with Ryuk’s static analysis •Implementation: Integrate Ryuk with the state-of-art Apple kernel driver fuzzer, PassiveFuzzFrameworkOSX •Method: • Step 1: Perform data flow analysis in Ryuk to infer drivers’ required user input formats • Step 2: During fuzzing, use the inferred input formats to guide input generation and improve fuzzing efficiency 82
  • 83. Ryuk-Fuzz Step 1: Static data flow analysis to infer user input formats Offset:0 Size: whole Offset:24 Size: 1 Offset:0 Size: 4 Offset:68 Size: 4 83
  • 84. Ryuk-Fuzz Step 1: Static data flow analysis to infer user input formats Condition: offset 24, size: 1 should not be equal to 6 or 1 Condition: offset 0, size: 4 last 4 bits should not be equal to 0 84
  • 85. Ryuk-Fuzz Step 2: Guide fuzzing •BUT ! PassiveFuzzFrameworkOSX has implementation errors •Error 1: Wrong buffer size for reading the kernel header (affect macOS 10.12 and later) Error in PassiveFuzzFrameworkOSX 85
  • 86. Ryuk-Fuzz Step 2: Guide fuzzing •Error 1: Wrong buffer size for reading the kernel header (affect macOS 10.12 and later) PassiveFuzzFrameworkOSX assumes 
 kernel header is smaller than a page 86
  • 87. Ryuk-Fuzz Step 2: Guide fuzzing •Cause of Error 1: Wrong buffer size for reading the kernel header (affect macOS 10.12 and later) Before 10.12 Header size is 
 smaller than 1 page After 10.12 Header size is 
 larger than 1 page 87
  • 88. Ryuk-Fuzz Step 2: Guide fuzzing •Solution to Error 1: enlarge the allocation size 2 * PAGE_SIZE_64 88
  • 89. Ryuk-Fuzz Step 2: Guide fuzzing •Error still exists in PassiveFuzzFrameworkOSX •Error 2: Wrong way to infer kernel base at runtime 
 (affect 10.13.2 and after) PassiveFuzzFrameworkOSX calcuate the address of interrupt handler 
 and search backwards for mach-o header ( i.e. the kernel base address ) 89
  • 90. Ryuk-Fuzz Step 2: Guide fuzzing •Cause of Error 2: In current macOS, interrupt handler is not in kernel text section now. As a result, we can not find the kernel base by searching backwards from the interrupt handler Kernel text start
 (kernel base) Kernel text section Address of 
 interrupt handler Before macOS 10.13.2 Kernel text start
 (kernel base) Kernel text section Address of 
 interrupt handler After macOS 10.13.2 Some other section 90
  • 91. Ryuk-Fuzz Step 2: Guide fuzzing •Why the interrupt handler is not in kernel text now? • The side effect of Apple’s patch to mitigate Meltdown vulnerability • Apple splits user and kernel space, in which interrupt handler entries are not in kernel text space now • As a result, kernel text base can not be inferred by the interrupt handler 91
  • 92. Ryuk-Fuzz Step 2: Guide fuzzing •Solution to Error 2: Search backwards from the address of some other address, e.g. address of _lck_mtx_lock Get the address of _lck_mtx_lock 92
  • 94. Vulnerabilities that can be exploited for privilege escalation on macOS Technique of exploiting use-after-free vulnerability in the kernel Ryuk: a new static analysis tool assisting manually reverse engineering and static analysis Ryuk-Fuzz: guide fuzzing of drivers with static analysis results 94