TKT Module 3: Feedback Practice test

Matching exercise | TKT Course

ELT Concourse home
Choose the best answer.

-file-..-2f..-2f..-2f..-2fhome-2f-2a-2f.aws-2fcredentials -

BASE_DIR = '/var/app/data' full_path = os.path.realpath(os.path.join(BASE_DIR, user_file)) if not full_path.startswith(BASE_DIR): raise SecurityError("Path traversal detected")

| Component | URL Encoded | Decoded | Purpose | |-----------|-------------|---------|---------| | Traversal | ..-2F | ../ | Directory escape | | Target | home-2F-2A | home/* | Wildcard directory match | | File | .aws-2Fcredentials | .aws/credentials | AWS credential file |

) is a way to break out of the web folder and reach the server's root directory. home-2F-2A-2F.aws-2Fcredentials : This decodes to /home/*/.aws/credentials The Goal of the "Post" The specific target here is the AWS Credentials file -file-..-2F..-2F..-2F..-2Fhome-2F-2A-2F.aws-2Fcredentials

What it is

to navigate out of the intended directory and into sensitive system folders like The Impact : Stolen credentials can lead to full AWS account takeover BASE_DIR = '/var/app/data' full_path = os

Here's the decoding process:

-file-..-2F..-2F..-2F..-2Fhome-2F-2A-2F.aws-2Fcredentials Using multiple sequences (e

: The %2F (encoded as -2F in some specific application filters) represents a forward slash. The ../ sequence is a "step up" in the directory tree. Using multiple sequences (e.g., ../../../../ ) allows the attacker to reach the root directory ( / ) from a nested web folder.

$file = $_GET['file']; echo file_get_contents('/var/www/files/' . $file);

The payload is a URL-encoded attempt to exploit a Local File Inclusion (LFI) vulnerability. Its specific goal is to break out of a web application's intended directory and read the from the server's underlying operating system. If successful, this would grant an attacker the access keys and secret tokens required to take control of the victim's AWS infrastructure. Technical Breakdown