CompTIA CASP+ (CAS-004) — Question 530

A network administrator who manages a Linux web server notices the following traffic:

http://comptia.org/../../../../etc/shadow

Which of the following is the BEST action for the network administrator to take to defend against this type of web attack?

Answer options

Correct answer: B

Explanation

The correct answer is B, as validating server input and ensuring it is appropriately appended to the base directory path helps prevent directory traversal attacks like the one shown. Options A, C, and D, while important security practices, do not specifically address the vulnerability presented by the attempt to access the /etc/shadow file via URL manipulation.