Overview¶
Enumeration is the process of gathering information about a system and its users. It is widely used in:
-
System administration
-
Troubleshooting
-
Cybersecurity and penetration testing
This guide covers essential commands for user and system enumeration in Linux.
User Enumeration¶
whoami — Current Logged-in User¶
Explanation
Displays the username of the currently logged-in user.
Example Output¶
hostname — System Hostname¶
Explanation
Shows the name of the current system (machine name).
Change Hostname¶
Explanation
-
Opens the hostname configuration file
-
Modify the hostname and save
-
Changes apply after reboot or reload
id — User Identity Information¶
Explanation
Displays detailed information about the current user.
Example Output¶
Breakdown¶
-
uid→ User ID -
gid→ Primary group ID -
groups→ All groups the user belongs to
who — Logged-in Users¶
Explanation
Shows users currently logged into the system.
groups — User Group Information¶
Explanation
Displays groups of the current user.
Check Groups for Specific User¶
Explanation
Lists all groups associated with the root user.
System Enumeration¶
lsb_release — Distribution Information¶
Explanation
Displays Linux distribution details.
Output Includes¶
-
Distributor ID
-
Description
-
Release version
-
Codename
View Release Files¶
Explanation
Displays distribution-related configuration files.
lscpu — CPU Information¶
Explanation
Shows detailed CPU architecture and specifications.
Output Includes¶
-
CPU model
-
Number of cores
-
Architecture (x86_64, etc.)
-
Threads per core
uname — System Information¶
Explanation
Prints basic system/kernel information.
Common Options¶
Explanation
Displays all system information.
- Shows kernel name
- Shows kernel version
- Shows processor type
- Shows hardware platform
- Shows operating system
Example Output¶
Practical Use Cases¶
Example 1: Basic Enumeration¶
Purpose
Identify current user and system identity.
Example 2: System Information Gathering¶
Purpose
Gather OS and hardware details.
Example 3: User and Group Analysis¶
Purpose
Understand user access and privileges.
Important Notes¶
-
Enumeration is the first step in penetration testing
-
Helps identify system weaknesses and misconfigurations
-
Some commands may require root privileges for full output
Summary Table¶
| Command | Purpose |
|---|---|
whoami |
Current user |
hostname |
System name |
id |
User identity details |
who |
Logged-in users |
groups |
User group info |
lsb_release -a |
Distribution details |
cat /etc/*release |
OS release info |
lscpu |
CPU details |
uname |
System/kernel info |
Conclusion¶
User and system enumeration commands are essential for:
-
Understanding system configuration
-
Managing users and permissions
-
Performing cybersecurity assessments
Mastering these commands allows you to quickly gather critical system insights in any Linux environment.