Synopses & Reviews
The honeymoon is over.
Prepare yourself to thwart Mac attacks.
Where security is concerned, Macs have long led a charmed existence. No more. If you manage security for a network that includes OS X machines, this update on the strengths and weaknesses of Mac OS X is required reading.
Beginning with the core differences between Mac OS X and Windows or Linux, this book follows the steps an attacker would take. You will learn the tools needed to find vulnerabilities, the techniques used to exploit them, and the means by which attackers maintain control once they gain access. When you know how they get in, you'll know how to keep them out.
See what makes Mac OS® X unique, what security improvements were added with Leopard®, and where vulnerabilities lie
Explore uncommon protocolsBonjour®, the QuickTime® file format, and RTSP
Look for bugs in Apple's source code or use a black box technique such as fuzzing
Examine stack overflow and heap overflow attacks directed at PowerPC and x86 architectures, as well as shellcodes and payloads
Learn to inject code into running processes and how attackers use this technique
Understand Mac OS X-specific rootkit techniques
The book focuses on how to find flaws in software on MacOS X and demonstrate their risk by developing proof-of-concept exploits for those vulnerabilities. The material shows what sort of attacks are prevented by Leopard's security defenses and what sort of attacks are not prevented. This information is valuable to security professionals securing MacOS X systems and applications that run on them (and by extension, the iPhone, which shares a very similar architecture). This is information that is known by "bad guys" and so the "good guy" authors are making sure that security professionals have access to this same information. The ideas and techniques are mostly offensive in nature.
As more and more vulnerabilities are found in the Mac OS X (Leopard) operating system, security researchers are realizing the importance of developing proof-of-concept exploits for those vulnerabilities. This unique tome is the first book to uncover the flaws in the Mac OS X operating system—and how to deal with them. Written by two white hat hackers, this book is aimed at making vital information known so that you can find ways to secure your Mac OS X systems, and examines the sorts of attacks that are prevented by Leopard’s security defenses, what attacks aren’t, and how to best handle those weaknesses.
About the Author
CharlIe Millerwon the second CanSecWest Pwn2Own contest in 2008 and was named one of the Top 10 Computer Hackers of 2008 by Popular Mechanics.
Dino Dai Zovi won the first CanSecWest Pwn2Own contest in 2007 and was named one of the 15 Most Influential People in Security by eWEEK.
Table of Contents
Part I Mac OS X Basics.
Chapter 1 Mac OS X Architecture.
Darwin and Friends.
Tools of the Trade.
Universal Binaries and the Mach-O File Format.
Mach-O File Format.
Stack Protection (propolice).
Chapter 2 Mac OS X Parlance.
Get an IP Address.
Set Up Name Translation.
Chapter 3 Attack Surface.
Searching the Server Side.
Nonstandard Listening Processes.
Cutting into the Client Side.
All of Safari’s Children.
Safe File Types.
Having Your Cake.
Part II Discovering Vulnerabilities.
Chapter 4 Tracing and Debugging.
Good Ol’ GDB.
D Programming Language.
Example: Using Dtrace.
Example: Using ltrace.
Example: Instruction Tracer/Code-Coverage Monitor.
Example: Memory Tracer.
Binary Code Coverage with Pai Mei.
iTunes Hates You.
Chapter 5 Finding Bugs.
Old-School Source-Code Analysis.
Getting to the Source.
CanSecWest 2008 Bug.
vi + Changelog = Leopard 0-day.
Apple’s Prerelease-Vulnerability Collection.
Chapter 6 Reverse Engineering.
EIP-Relative Data Addressing.
Messed-Up Jump Tables.
Identifying Missed Functions.
Cleaning Up Obj-C.
Shedding Light on objc_msgSend Calls.
Part III Exploitation.
Chapter 7 Exploiting Stack Overflows.
Stack Usage on PowerPC.
Stack Usage on x86.
Smashing the Stack on PowerPC.
Smashing the Stack on x86.
Exploiting the x86 Nonexecutable Stack.
Return into system().
Executing the Payload from the Heap.
Finding Useful Instruction Sequences.
Chapter 8 Exploiting Heap Overflows.
The Scalable Zone Allocator.
Freeing and Allocating Memory.
Overwriting Heap Metadata.
Arbitrary 4-Byte Overwrite.
Large Arbitrary Memory Overwrite.
Obtaining Code Execution.
Taming the Heap with Feng Shui.
Fill ’Er Up.
Feng Shui Example.
Chapter 9 Exploit Payloads.
Mac OS X Exploit Payload Development.
Forking a New Process.
Executing a Shell.
Encoders and Decoders.
Staged Payload Execution.
PowerPC Exploit Payload.
Testing Simple Components.
Putting Together Simple Payloads.
Intel x86 Exploit Payloads.
Testing Complex Components.
Chapter 10 Real-World Exploits.
QuickTime RTSP Content-Type Header Overflow.
Triggering the Vulnerability.
Exploitation on PowerPC.
Exploitation on x86.
mDNSResponder UPnP Location Header Overflow.
Triggering the Vulnerability.
Exploiting the Vulnerability.
Exploiting on PowerPC.
QuickTime QTJava toQTPointer() Memory Access.
Obtaining Code Execution.
Part IV Post-Exploitation.
Chapter 11 Injecting, Hooking, and Swizzling.
Introduction to Mach.
Mach Security Model Mach Exceptions.
Remote Process Memory.
Loading a Dynamic Library or Bundle.
Example: iSight Photo Capture.
Objective-C Method Swizzling.
Example: iChat Spy.
Chapter 12 Rootkits.
Hiding the Rootkit.
Maintaining Access across Reboots.
Controlling the Rootkit.
Creating the RPC Server.
Injecting Kernel RPC Servers.
Calling the Kernel RPC Server.