Attacks and Exploits

A download endpoint strips the string "../" once from the file parameter, then reads the file from a folder below the web root. Which value BEST retrieves /etc/passwd?

Show the answer

Correct answerC. ....//....//....//....//etc/passwd

AWhy not this: This is a SQL injection string, and the endpoint reads files rather than querying a database.

BWhy not this: This is command injection syntax, but the endpoint opens a path and does not pass input to a shell.

CWhy this is right: After the single-pass filter removes the inner "../", each "....//" becomes "../", which is a traversal bypass.

DWhy not this: A remote URL is a remote file inclusion payload and does not read a local system file.

A non-recursive filter removes the inner "../" and leaves a valid "../", so nested sequences still climb out of the folder. A remote URL is a file inclusion payload and does not read a local file.