CompTIA CASP+ (CAS-004) — Question 271
A security engineer is assessing a legacy server and needs to determine if FTP is running and on which port. The service cannot be turned off, as it would impact a critical application's ability to function. Which of the following commands would provide the information necessary to create a firewall rule to prevent that service from being exploited?
Answer options
- A. service –-status-all | grep ftpd
- B. chkconfig –-list
- C. netstat –tulpn
- D. systemctl list-unit-file –-type service ftpd
- E. service ftpd status
Correct answer: C
Explanation
The command 'netstat –tulpn' provides a detailed list of all active connections and listening ports, including the associated services, which is essential for creating a firewall rule. The other options either check service status without providing port information or are not applicable for this particular task.