Hay còn gọi là directory traversal, là một kỹ thuật giúp truy cập vào những tập tin nằm bên ngoài thư mục gốc của ứng dụng.
Để tấn công, cần sử dụng một URL có nhận vào input là tên tập tin, ví dụ như sau: http://webapp.thm/get.php?file=
. Ta truyền vào giá trị của parameter file
là chuỗi các ký tự ../
(nhằm truy xuất đến thư mục cha). Khi đường dẫn chạm đến một tập tin, nội dung của tập tin sẽ được xuất ra.
Sau đây là danh sách các tập tin phổ biến có thể khai thác ở các hệ điều hành khác nhau:
Location | Description |
---|---|
/etc/issue | contains a message or system identification to be printed before the login prompt. |
/etc/profile | controls system-wide default variables, such as Export variables, File creation mask (umask), Terminal types, Mail messages to indicate when new mail has arrived |
/etc/passwd | has all registered user that has access to a system |
/etc/shadow | contains information about the system’s users’ passwords |
/root/.bash_history | contains the history commands for root user |
/root/.ssh/id_rsa | private SSH keys for a root or any known valid user on the server |
/var/log/dmessage | contains global system messages, including the messages that are logged during system startup |
/var/mail/root | all emails for root user |
/var/log/apache2/access.log | the accessed requests for Apache webserver |
/proc/version | specifies the version of the Linux kernel |
C:\boot.ini | contains the boot options for computers with BIOS firmware |