CompTIA Security+ Exam: SY0-601 | Directory-Traversal Attack Explanation

Directory-Traversal Attack

Prev Question Next Question

Question

A cybersecurity analyst reviews the log files from a web server and sees a series of files that indicate a directory-traversal attack has occurred.

Which of the following is the analyst MOST likely seeing?

A.

http://sample.url.com/ B.

http://sample.url.com/someotherpageonsite/../../../etc/shadow C.

http://sample.url.com/select-from-database-where-password-null D.

http://redirect.sameple.url.sampleurl.com/malicious-dns-redirect.

B.

Explanations

A cybersecurity analyst reviews the log files from a web server and sees a series of files that indicate a directory-traversal attack has occurred.

Which of the following is the analyst MOST likely seeing?

A.

http://sample.url.com/<script>Please-Visit-Our-Phishing-Site</script>

B.

http://sample.url.com/someotherpageonsite/../../../etc/shadow

C.

http://sample.url.com/select-from-database-where-password-null

D.

http://redirect.sameple.url.sampleurl.com/malicious-dns-redirect

B.

The cybersecurity analyst is most likely seeing a directory-traversal attack in the log files of the web server. In such an attack, the attacker attempts to access files and directories that are outside of the web server's root directory by manipulating the input parameters in the URL. The attacker can then potentially access sensitive system files, such as configuration files, password files, and other sensitive data.

Option B in the list provided in the question indicates a directory-traversal attack as it shows the use of ".." to move up one or more levels in the directory structure. The attacker attempts to access the file "/etc/shadow," which is a system file that stores encrypted password information. Accessing this file could provide the attacker with the means to decrypt the passwords and gain unauthorized access to the system.

Option A is a script injection attack, where the attacker inserts malicious code into the webpage, which executes on the client-side when the page is rendered.

Option C appears to be a SQL injection attack, where the attacker inserts malicious code into an SQL query to extract or modify data in the database.

Option D is a DNS redirection attack, where the attacker redirects traffic from a legitimate website to a malicious site.

In summary, based on the information provided, the analyst is most likely seeing a directory-traversal attack in option B, which involves attempting to access system files outside the web server's root directory by manipulating the input parameters in the URL.