CompTIA PenTest+ (PT0-003) — Question 81
A penetration tester is enumerating a Linux system. The goal is to modify the following script to provide more comprehensive system information:
#!/bin/bash
ps aux >> linux enum.txt
Which of the following lines would provide the most comprehensive enumeration of the system?
Answer options
- A. cat /etc/passwd >> linux_enum.txt netstat -tulr >> linux_enum.txt cat /etc/bash.bashrc >> linux_enum. txt
- B. whoami >> linux_enum.txt uname -a >> linux_enum.txt ifconfig >> linux_enum.txt
- C. hostname >> linux_enum.txt echo $USER >> linux_enum.txt curl ifconfig.me >> linux_enum.txt
- D. lsof -i >> linux_enum.txt uname -a >> linux_enum.txt ls /home/ >> linux_enum.txt
Correct answer: A
Explanation
Option A is the most comprehensive as it gathers user account information from /etc/passwd, active network connections with netstat, and global bash configurations from /etc/bash.bashrc. The other options provide useful information but do not cover as many aspects of the system, such as network configuration and user accounts.