Overview

This course accompanies Jonathan Levin's highly praised trilogy, '*OS Internals,' with deeper discussions and hands-on examples. It focuses on macOS Monterey (10.17), Ventura (10.18), and iOS versions 15 and 16, covering significant changes in these later versions. The course explores Apple's operating systems from a reverse engineer’s perspective, offering in-depth coverage of both documented and undocumented features, tools, and updates. The content is taught by the author himself and presents an opportunity to master reverse engineering techniques for macOS and iOS.

Read more +

Prerequisites

  • Knowledge of macOS at a user level, including user-mode programming.
  • Familiarity with x86_64 and/or ARM64 is highly recommended.
  • Bring your own Mac or jailbroken i-Device.

Target Audience

  • Reverse Engineers
  • Security Researchers
  • Malware Researchers
  • Forensics Experts

Particularly those interested in macOS and iOS and reverse engineering techniques specific to Apple’s operating systems.

Read more +

Delegates will learn how to

  • Understand the process of binary linking and loading.
  • Reverse engineer and analyse Mach-O binaries.
  • Reverse engineer Objective-C and Swift code.
  • Use Apple’s documented and undocumented APIs for tracing and debugging.
  • Explain, interface with, and hook kernel system calls.
  • Identify and explain common malware techniques.
  • Understand attack surfaces in macOS and iOS, particularly in the kernel, kexts (I/O Kit), and system daemons.
Read more +

Outline

The course covers the following modules over five days, with hands-on exercises and guided demos:

Architectural Overview (3 hours)

  • Introduction to the Architecture of macOS and iOS.
  • Review of Apple's architectural diagrams and corrections for accuracy.
  • Overview of iOS derivatives (TvOS, WatchOS).
  • Introduction to private frameworks.
  • The Darwin environment and XNU kernel.
  • Hardware architecture for macOS (x86, x86_64, x86_64h) and iOS (armv8, A7+, A11).
  • Apple Silicon and Rosetta II.
  • Using sysctl for hardware details and MobileGestalt for software and hardware details.

Binaries (2+1 hours)

  • Detailed examination of the Mach-O file format.
  • Types of Mach-O files: Executables, bundles, dylibs, kexts, cores.
  • Load commands, LC_SEGMENT[64], and process virtual memory setup.
  • DYLD dependencies, code signing, and code encryption.
  • Tools like otool(1) and JTool2 for static analysis.
  • Exercises include analysing user-mode malware or other binaries and defeating code encryption in iOS.

Advanced Mach-O and DYLD (2+2 hours)

  • Exploring lesser-known aspects of DYLD, Mach-O Loader, and loader opcodes.
  • Dynamic linking, rebasing chains, and DYLD callbacks.
  • Exercises include extending and hacking DYLD.

Debugging and Tracing Techniques (2+1 hours)

  • Built-in tools for debugging and profiling macOS/iOS processes.
  • Using LLDB, malloc_history, vmmap, sc_usage, and other tracing tools.
  • Endpoint Security Framework and DTrace for macOS.
  • Exercises include using KDebug, Process Explorer, and creating filters.

Launchd and XPC (2+1 hours)

  • Describing macOS and iOS startup via launchd, LaunchDaemons, and LaunchAgents.
  • Malware persistence through Launchd.
  • Introduction to Mach ports, Mach services, and XPC APIs.
  • Exercises include listing Mach and XPC endpoints, and adding a LaunchDaemon or LaunchAgent.

Mach Primitives and IPC (3+2 hours)

  • Core concepts of XNU and Mach kernel, tasks, threads, and message passing.
  • Remote code injection using Mach APIs.
  • Exercises include enumerating Mach tasks and using Mach APIs for thread injection.

XNU Kernel, Up Close (1 hour)

  • Detailed look at the XNU kernel, source tree layout, and compiling options.
  • Reverse engineering without XNU source code (iOS).
  • Introduction to the Kernel Debug Kit.

Programming KEXTs and DEXTs (1+1 hours)

  • Architecture of Kernel Extensions (KEXTs) and Driver Extensions (DEXTs).
  • Commands for managing KEXTs: kextstat, kextutil, and kmutil.
  • OSKext* APIs and dependency handling.
  • Exercises include building a KEXT and using OSKext APIs for kernel memory inspection.

I/O Kit (2+2 hours)

  • In-depth exploration of I/O Kit, object-oriented driver runtime in XNU.
  • IOUserClients, IOConnectCall* methods, and I/O Registry.
  • Exercises include reverse engineering I/O Kit kernel modules and creating a simple fuzzer.

The Network Stack (Optional) (1+1 hours)

  • Layer-by-layer discussion of the BSD-based network stack in macOS/iOS.
  • Protocol implementations, interface filters, and Berkeley Packet Filter (BPF).
  • Exercises include installing packet filters and intercepting connections.

Security (4 hours)

  • Detailed look at macOS and iOS security mechanisms like AppleMobileFileIntegrity and the Sandbox kernel extensions.
  • Code signing, entitlement handling, quarantine, and Gatekeeper.
  • Detailed deconstruction of malware examples, including the NSO Group’s “Pegasus” for iOS.
  • Exercises include analysis of student-provided malware samples.
Read more +

Why choose QA

Cyber Security learning paths

Want to boost your career in cyber security? Click on the roles below to see QA's learning pathways, specially designed to give you the skills to succeed.

= Required
= Certification
AI Security
Application Security
Cyber Blue Team
Cybersecurity Maturity Model Certification (CMMC)
Cloud Security
DFIR Digital Forensics & Incident Response
Industrial Controls & OT Security
Information Security Management
NIST Pathway
Offensive Security
Privacy Professional
Reverse Engineer
Secure Coding
Security Auditor
Security Architect
Security Risk
Security Tech Generalist
Vulnerability Assessment & Penetration Testing

Offensive Cyber Operations learning paths

Want to boost your career in the world of Offensive Cyber Operations? View QA's learning pathway below, specially designed to give you the skills to succeed.

= Required
= Certification
Offensive Security
Vulnerability Assessment & Penetration Testing
Reverse Engineer
Need to know

Frequently asked questions

How can I create an account on myQA.com?

There are a number of ways to create an account. If you are a self-funder, simply select the "Create account" option on the login page.

If you have been booked onto a course by your company, you will receive a confirmation email. From this email, select "Sign into myQA" and you will be taken to the "Create account" page. Complete all of the details and select "Create account".

If you have the booking number you can also go here and select the "I have a booking number" option. Enter the booking reference and your surname. If the details match, you will be taken to the "Create account" page from where you can enter your details and confirm your account.

Find more answers to frequently asked questions in our FAQs: Bookings & Cancellations page.

How do QA’s virtual classroom courses work?

Our virtual classroom courses allow you to access award-winning classroom training, without leaving your home or office. Our learning professionals are specially trained on how to interact with remote attendees and our remote labs ensure all participants can take part in hands-on exercises wherever they are.

We use the WebEx video conferencing platform by Cisco. Before you book, check that you meet the WebEx system requirements and run a test meeting (more details in the link below) to ensure the software is compatible with your firewall settings. If it doesn’t work, try adjusting your settings or contact your IT department about permitting the website.

How do QA’s online courses work?

QA online courses, also commonly known as distance learning courses or elearning courses, take the form of interactive software designed for individual learning, but you will also have access to full support from our subject-matter experts for the duration of your course. When you book a QA online learning course you will receive immediate access to it through our e-learning platform and you can start to learn straight away, from any compatible device. Access to the online learning platform is valid for one year from the booking date.

All courses are built around case studies and presented in an engaging format, which includes storytelling elements, video, audio and humour. Every case study is supported by sample documents and a collection of Knowledge Nuggets that provide more in-depth detail on the wider processes.

When will I receive my joining instructions?

Joining instructions for QA courses are sent two weeks prior to the course start date, or immediately if the booking is confirmed within this timeframe. For course bookings made via QA but delivered by a third-party supplier, joining instructions are sent to attendees prior to the training course, but timescales vary depending on each supplier’s terms. Read more FAQs.

When will I receive my certificate?

Certificates of Achievement are issued at the end the course, either as a hard copy or via email. Read more here.

Let's talk

By submitting this form, you agree to QA processing your data in accordance with our Privacy Policy and Terms & Conditions. You can unsubscribe at any time by clicking the link in our emails or contacting us directly.