RedTeam Nexus Labs
Module 23 · Lesson 02 // Privilege Escalation

enumeration

Privilege Escalation · CTF

Freereading · 10 min
On this page
LESSON

Overview

Once you have a low-privileged foothold on an authorized lab target, the next step is almost never to "attack" anything — it is to look. Privilege-escalation enumeration is the systematic process of gathering information about the system so you understand what you can currently do, what higher-privileged things exist, and where the two might connect. The saying "enumeration is the key to privilege escalation" holds because escalation almost always comes from noticing a misconfiguration, not from a secret exploit.

This lesson covers enumeration at the concept level: what categories of information matter and why, from the perspective of someone with a sanctioned foothold on an isolated practice machine. The same checklist is exactly what a defender or system auditor walks to find and fix these issues before an attacker can, so learning to enumerate is directly a hardening skill.

Learning objectives

  • Explain why enumeration precedes any escalation attempt.
  • List the main categories of information worth reviewing after gaining a foothold.
  • Describe what each category reveals about possible privilege boundaries.
  • Connect enumeration to defensive auditing and hardening.

Core concept

Enumeration is disciplined information gathering. After landing as a low-privileged user, an attacker (in a lab) or an auditor (defending a real system) asks a consistent set of questions to build a map of the system's privilege surface:

  • Who am I, and what am I allowed to do?
  • What higher-privileged things run on this machine?
  • Where do low-privileged inputs feed into high-privileged actions?

The goal is to find a path from where you are to where you want to be, or — defensively — to find every such path and cut it. Escalation opportunities are usually the product of configuration, so enumeration is mostly reading state, not exploiting anything. It is quiet, methodical, and comprehensive: the biggest mistake is skipping a category and missing the one weakness that mattered.

How it works

A thorough post-foothold review walks a checklist of categories. Each is described here conceptually — as what to review and why — rather than as a copy-paste attack recipe.

  • Identity and context — Which user and groups am I? What is my session, hostname, and the OS/kernel version? Your group memberships in particular can reveal inherited capabilities, and the OS/version frames what defenses and features exist.
  • User accounts — What other users exist, and which are privileged? Which accounts own sensitive processes or files? This maps the horizontal and vertical targets.
  • Elevated rights I already hold — On Linux, whether the account has any sudo rights (commands it may run as another user, often root) is one of the highest-value things to know. On Windows, the equivalent is which privileges and group memberships the token carries.
  • SUID/SGID and special permissions — On Linux, programs marked SUID/SGID run with the file owner's (often root's) privileges regardless of who launches them. The set of such programs, and whether any are unusual, is a key enumeration item because a mis-set bit here can be a direct boundary crossing.
  • Services and their accounts — What services run, under which accounts, and with what permissions? A service running with excessive privilege, or whose files a low-privileged user can modify, is a classic escalation avenue.
  • Scheduled tasks / cron — What runs automatically, as whom, and on what schedule? A scheduled job that executes as root but invokes something a low-privileged user can influence is a recurring source of escalation.
  • Writable paths — Which files and directories can my account write to, especially ones that privileged processes read or execute? Writable configuration, scripts, or binaries used by higher-privileged code are prime findings.
  • Environment and configuration — Environment variables (notably how executables are located), stored credentials in config files or history, mounted filesystems, and installed software. Secrets left readable are a frequent, avoidable weakness.

Two properties make enumeration effective: breadth (cover every category) and correlation (the escalation is usually where two categories intersect — e.g., a root cron job and a writable script it runs).

Practical example

On an isolated lab VM you have a foothold as the user web. Instead of guessing, you methodically review each category. You confirm your identity and groups, note the OS version, and list other users. You check whether web has any sudo rights and review which programs carry SUID bits. You look at running services and the accounts behind them, list scheduled/cron jobs and who they run as, and identify directories web can write to. Finally you skim readable configuration for leftover secrets.

The escalation, when you find it, lives at an intersection you surfaced: for example, a scheduled job that runs as root and references a script located in a directory web can write to. You did not exploit anything to discover that — you read state and correlated it. A defender auditing the same box walks the identical checklist and, on finding that intersection, fixes the writable path or the job before any attacker benefits.

Cybersecurity relevance

Enumeration is where offense and defense meet. For a red-team member on an authorized engagement, it is the unglamorous work that actually produces escalations. For a defender, the very same checklist is a hardening and audit routine: reviewing sudo rights, SUID inventories, service accounts, scheduled tasks, and writable paths is how you find over-privilege and misconfiguration before they are abused. Many security baselines and auditing tools automate exactly these checks. Learning to enumerate therefore teaches you to see your systems the way an attacker would — the essential first step to defending them.

Common mistakes

  • Jumping to exploitation before understanding the system, and missing the easy, obvious path.
  • Covering only one category (e.g., only SUID) and overlooking sudo rights, cron, or writable paths.
  • Failing to correlate findings — the escalation is often the intersection of two individually harmless-looking facts.
  • Ignoring the account's own rights — sometimes the foothold account already has enough (sudo, a powerful group) with no further trick needed.
  • Doing this outside authorization — enumeration is still activity on a system, and must stay confined to lab targets you are permitted to test.

Key takeaways

  • Enumeration — systematic information gathering after a foothold — is the key to privilege escalation and to defensive auditing alike.
  • Core categories: identity/groups, other users, existing elevated rights (sudo / token privileges), SUID/SGID, services and their accounts, scheduled tasks/cron, writable paths, and environment/configuration.
  • Escalations usually appear at the intersection of categories (e.g., a root job plus a writable script), so cover everything and correlate.
  • The same checklist a lab attacker uses is exactly what a defender walks to find and fix over-privilege before it is abused.

Check your understanding

  • Why is enumeration considered more important than knowing specific exploits for privilege escalation?
  • Give an example of two enumeration findings that are dangerous only when combined.
  • How does the enumeration checklist double as a defensive hardening audit?
FINISH THIS LESSON

Sign in to save your progress.