You will run all of the experiments in this learning path within a Docker container. Perform the following steps to build the docker container.

Create a file named Dockerfile with the following content on your AArch64 linux machine:


            FROM ubuntu:22.04

RUN apt-get update && apt-get install -y \
 clang gdb \
 && rm -rf /var/lib/apt/lists/*

# disable ASLR - needed for some of the experiments
RUN echo "kernel.randomize_va_space = 0" > /etc/sysctl.d/01-disable-aslr.conf

The last line in the Dockerfile disables the on-by-default ASLR mitigation Without this change, it will block the exploit you are going to build.

Also, you will use gdb in the docker image, which only works when the docker image and the host computer use the same instruction set.

Now, build a docker image from the description in the Dockerfile, by running the following command:


            docker build --tag armlearningpath/bufferoverflow:v1.0 .

This command builds the AArch64 linux docker container in which you will run the experiments.

Start the docker environment with the following command:


            docker run -i -t -v $(pwd):/armlearningpaths -w /armlearningpaths --security-opt seccomp=unconfined armlearningpath/bufferoverflow:v1.0

This will run AArch64 Ubuntu 22.04 in Docker. You will see the following prompt:




The directory /armlearningpaths maps to the current directory where you ran the docker run command. All changes you make in this directory will persist outside the docker container.