CSE Roadmap

Core tier · about 3 hours · 6 parts

Part 1 of 6 · 1 min read

Why this page comes fourth

In this module you will

  • State the principle of least privilege, and say why "root or nothing" breaks it.
  • Name several Linux capabilities and say what each one allows.
  • Read the capability lines of /proc/self/status and decode a mask.
  • Explain the five capability sets and how a program keeps one capability across a user change.
  • Show with a short C program that a process with one capability can do one privileged act and no other.

Page 2 showed that user 0 passes every permission check, and that a setuid program carries the owner's power. That is a very large power for a program that needs only one privileged act, such as binding to port 80. This page covers the Linux answer: the power of root is cut into pieces called capabilities, and a process may hold only some. Page 5 then turns to attacks that try to seize a process, and page 6 to the walls that limit one that is seized.

About this example About this example

Real: The C program in section 3 was compiled with gcc -Wall -Wextra and run as root on a Linux test machine (2 processors, kernel 6.18, glibc 2.39). The capability masks, the 40 capabilities and the first port that needs no privilege (1024) were read on that machine.

Scripted: The user nobody (ID 65534) stands for any unprivileged service account. A real web server would also change directory, drop other rights and log its actions.

Not real: The program tests port 80 and /etc/shadow only to show two different acts. It does not start a server.