Setup: Local Environment
We recommend you work within the container (Ubuntu 22.04) as we provide with Dockerfile. Please follow the following steps to setup your local environment.
-
Update the Package List:
Run the following command to ensure your package list is up to date:
sudo apt update
-
Install Python:
Python 3 should be pre-installed in Ubuntu 22.04. You can verify this by running:
python3 --version
If Python 3 is not installed, you can install it with:
sudo apt install python3
-
Install
pwntools
:Use
pip
(Python's package installer) to installpwntools
:sudo apt install python3-pip
pip3 install pwntools -
Verify Installation:
You can verify that
pwntools
has been installed correctly by starting a Python 3 interactive session:python3
Inside the Python shell, try importing
pwntools
:import pwn
If there are no errors, the installation was successful.
To solve CTF challenges, it would be very helpful to use pwntools
, a
powerful Python library designed for CTFs and binary
exploitation. pwntools
provides convenient functions to interact
with both local and remote binaries, allowing you to test
exploits locally before applying them to the remote server.
Next, we will first walk through the process of solving a problem
locally using pwntools
. Then, we'll demonstrate how to connect to
the remote server and retrieve the real flag.