Fundamentals of ARM Exploitation

Course Description

The ARM family of processors continue to grow in relevance, popularity, and performance. Once considered a bit of a niche, ARM now powers everything from cheap embedded devices to high-end smartphones, laptops, and even some servers. The utility of learning ARM related skills has never been higher.

This accelerated course will familiarize students with the fundamentals of binary exploitation as they manifest on the ARM architecture. By focusing on the relevant distinctions between ARM and other architectures, our course facilitates rapid skill-transfer, allowing students to apply their existing vulnerability research skillsets to ARM-based systems.

Students will walk away from this course with the foundation needed to confidently perform vulnerability research against ARM based binaries.


Learning Outcomes

  • Acquire an intimate understanding of systems-level ARM, and the confidence to read, debug, and exploit ARM based code
  • Bypass common exploit-mitigations on ARM and learn how techniques differ from x86-64
    • Stack Cookies, Data Execution Prevention, ASLR, PIE, PAC
  • Develop the ability and confidence to apply traditional and bespoke exploitation techniques against ARM binaries
    • Shellcoding, ROP, COP/JOP, Stack Pivoting, Information leaks
  • Acquire architectural context and comfort operating in the multiple ARM modes
    • Thumb, ARM (32), and aarch64
  • Possess the skills necessary to perform independent vulnerability research against applications without source code

Professional Certificate

Professional-tier users are eligible to redeem a professional RET2 WarGames certificate of training upon adequate completion of this course. For more info, please refer to the certificate info page.

Suggested Prerequisites

Please note, this course is intended for individuals who already possess some experience with binary exploitation concepts, or those with a strong background in low-level ARM concepts, but little security experience.

If you are looking for a course focused on teaching exploitation concepts from the ground up, please consider our Fundamentals of Software Exploitation courseware.

  • Prior familiarity with binary exploitation or reverse engineering concepts is highly recommended.
    • Unlike "Fundamentals of Software Exploitation", this course focuses on ARM specifics while assuming basic knowledge of exploitation concepts.
  • Working knowledge of C & Python
  • Basic familiarity with GDB or another command-line debugger
    • ELF files, GDB, the Linux command line

  Reverse Engineering

Before diving headfirst into exploitation, it is important to be comfortable reading, navigating, and understanding ARM assembly code.

This chapter will highlight major differences between x86-64 and ARM architectures while providing a series of increasingly difficult challenges that highlight those differences.
  • Introduction to ARM & Thumb Assembly concepts
  • Calling Conventions on ARM
  • ARM Addressing Modes & Conditional Suffixes

  Memory Corruption

Memory corruption will often cause a program to misbehave or crash, but with clever manipulation, it can be used to hijack program control flow.

This chapter will explain "classic" memory-corruption concepts, specifically in the context of binary exploitation on ARM. We will explore how the stack is managed and how simple buffer overflows can be used to hijack program control flow.

  • ARM Stack Frames
  • Control-Flow Hijacking
  • Stack-based memory corruption

  Shellcoding

Shellcoding is the practice of crafting small pieces of "malicious" assembly-code that can be injected into a running program by an exploit.

This chapter will teach you about writing shellcode payloads for ARM and the unique constraints involved that may not exist on x86-64, such as instruction alignment.

  • ARM Syscall Convention
  • Shellcode Alignment on ARM
  • Writing shellcode that can operate under common constraints

  Return Oriented Programming

Data Execution Prevention, known as the "Execute Never" (XN) bit on ARM, was designed to disarm code injection techniques (such as shellcoding) by ensuring that memory marked as "data" could not be executed by the CPU.

In this chapter, we walk through Return Oriented Programming (ROP) techniques as they exist on ARM. This includes a review of traditional ROP techniques such as stack-pivoting, as well as techniques that are much more common on ARM, such as COP & JOP.

  • Introduces the ARM XN bit
  • How to bypass DEP using Return Oriented Programming (ROP)
  • Building ROP chains on ARM
  • Advanced techniques: COP & JOP

  ARM64 - aarch64

While this course focuses on 32-bit ARM (armv7), the 64-bit variant architecture (aarch64) is dominant in most higher-end ARM devices. This chapter will introduce the fundamentals of ARM64, highlighting the major changes from its 32-bit predecessor. Fortunately, despite technically being a fully new architecture, aarch64 feels similar to work with.

This chapter will explore the new instruction set, calling convention, and the new exploit mitigations introduced in aarch64.

  • Introduction to aarch64
  • ARM64 Instructions and Calling Convention
  • New Exploit Mitigations in ARM64