Introduction to filesystem permissions on Linux
Before we begin exploring the process of exploiting SUID binaries to elevate our privileges, we need to take a brief look at filesystem permissions on Linux and how they can be used to provide or limit access to files and directories. This will help us set up the stage for our foray into SUID binaries, how they are configured, and how they can be exploited.
Filesystem permissions on Linux are used to grant or limit access to files and directories. This is a very useful feature as it allows users to restrict access to particular files or directories, thus preventing any unauthorized access.
We can list the permissions of a file or folder on Linux by running the following command:
ls -al
As highlighted in the following screenshot, this command will output a list of all the files in a directory and all their attributes, including their access permissions and ownership details: