XSS Injection - Stored(Blog, Change Secret)

chi·2024년 5월 7일

web hacking

목록 보기
4/15

Stored(Blog)

각자 form에 html을 그대로 쓰면 된다

<script>alert("warning")</script>
<script>alert(document.cookie)</script>

페이지에 스크립트가 계속 누적되기 때문에 경고창이 여러번 뜰 수 있다

high

xss_stored_1.php에서 난이도가 high일 때 htmlspecialchars(특수문자를 우회시키는 함수)를 사용하는 xss_check_3를 사용하기 때문에 입력한 스크립트가 문자 그대로 출력된다

Change Secret

secret change에서

<script>alert("warning")</script>
<script>alert(document.cookie)</script>

를 각자 입력하고 SQL Login user로 가서 로그인했을 떄 경고창이 뜬다

high

입력한 스크립트가 문자 그대로 출력되기만 하고 경고창이 뜨지 않는다
난이도가 high일 경우 ysqli_real_escape_string, htmlspecialchars을 사용하여
특수문자를 이스케이프(스크립트, 태그의 기능 상실)시키고 우회시키고 있다

0개의 댓글