Skip to main content

The Mindset

Once you’re on a box, user enumeration answers critical questions:
  • Who else is here? — Other user accounts are lateral movement targets
  • What privileges do I have? — Sudo rights, special groups, weak configs
  • Where are the credentials?/etc/shadow, history files, config files
  • Who can I become?su, sudo, token impersonation

The Key Files

/etc/passwd — User Account Database

Readable by everyone. Contains all user accounts on the system.
Each line follows this format:
Useful one-liners against /etc/passwd:

/etc/shadow — Password Hashes

Only readable by root. Contains the actual password hashes for all accounts. Getting here is a major milestone.
Each line format:
Hash algorithm prefixes: Once you have hashes, crack them:

/etc/group — Group Definitions

High-value groups to look for:

Current User Enumeration


All Users on the System


Switching & Executing as Another User

su — Switch User

sudo — Execute as Another User

Reading sudo -l output:
Any NOPASSWD entry is an immediate privesc vector. Check GTFOBins for the binary listed.
(ALL : ALL) ALL means the user can run any command as any user — they effectively have root. (ALL) NOPASSWD: ALL is the same but without needing a password.

User Management Commands

These are useful to know both for administration and for understanding what happened on a compromised box: Adding yourself to a privileged group (if you have write access to /etc/group):

Hunting Credentials Across the System

With user enumeration complete, pivot to credential hunting:

Next: Process & Service Management — enumerating running processes, services, and cron jobs to find attack surface.