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.
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.
Once you have hashes, crack them:
/etc/group — Group Definitions
Current User Enumeration
All Users on the System
Switching & Executing as Another User
su — Switch User
sudo — Execute as Another User
sudo -l output:
NOPASSWD entry is an immediate privesc vector. Check GTFOBins for the binary listed.
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.