CompTIA PenTest+ (PT0-003) — Question 34

A penetration tester gains access to a Linux computer system. The tester then attempts to enumerate user accounts, including the directories and user default shell. Which of the following commands should the tester use to enumerate user accounts?

Answer options

Correct answer: D

Explanation

The correct command is 'cat /etc/passwd', as it displays user account information, including usernames, home directories, and default shells. 'cat /etc/shadow' is used for password hashes but does not enumerate user accounts. 'ls /var/usr' is not a standard directory for user accounts, and 'ls /home' only lists home directories without user details.