Tiny Bunny

Rookies/클라우드 기반 취약점 진단 및 대응 실무

[SK shieldus Rookies 19기] 09 - Directory Traversal (Burp Suite Academy)

bento 2024. 5. 15. 23:33
[SK쉴더스 Rookies 19기] 클라우드 기반 스마트 융합보안 과정

https://portswigger.net/web-security/file-path-traversal/lab-simple

 

Lab: File path traversal, simple case | Web Security Academy

This lab contains a path traversal vulnerability in the display of product images. To solve the lab, retrieve the contents of the /etc/passwd file. Solution ...

portswigger.net

 

가. 문제점

[CASE 9] Directory Traversal

Web Security Academy 서비스 내 일부 페이지에서 다운로드를 담당하는 변수 입력 값에 대한 필터링 검증이 부재하여 웹페이지 접속 시 파일 다운로드 소스로 붙어 있는 파라미터 값을 변조하여 웹을 통해 웹 어플리케이션의 소스파일 및 시스템 파일에 접근하거나 읽을 수 있는 가능성이 존재합니다.

그림 1. 메인 페이지 접속

 

그림 2. 포스트의 파일을 가져오는 경로 확인

 

그림 3. 해당 경로를 조작하여 /etc/passwd를 다운로드

 

나. 관련 URL

번호 경로 URL
1 / /
2   /image?filename=

 

다. 해결 방안

파일이 위치하는 경로를 변수로 사용하지 않고 해당 파일의 키 값을 변수로 사용하여 다운로드 기능을 구현해야 합니다. 파일 위치 경로 변수를 사용할 경우, “../”, ”..\”, ”.\”, “%” 등 특수문자의 적절한 보안 필터링을 해야 합니다.

728x90