Wargame/BeeBox
Beebox[HTML Injection - Reflected (POST)]
2. Medium
(1) 입력

URL인코딩을 한 후 입력한 결과를
버프스위트로 잡아보려고 합니다

URL인코딩 후 위와 같이 요청했을 때!

[그림2] 요청에 대한 응답을 보면
HTML 인코딩이 되어있는 것을 확인할 수 있네요.

"%3ch1%3eABCD%3c/h1%3e"가 서버에 도착하면
<h1>ABCD</h1>로 변경되고
[그림4]의 연두색 박스인 str_replace함수에 의해
<와 >로 치환되는 것으로 보이네요.
그래서 보낼 때
<와 >부분만 더블인코딩을 해보려고 합니다.

인코딩할 때 %를 %25로 인코딩해서 보내면
서버가 해석할 때 %25를 %로 해석할 것이고
"%3ch1%3eABCD%3c/h1%3e"
이런식으로 보여지겠죠?
이 상태에서 [그림4]의 <와 >가 없기 때문에
노란색박스는 패스하겠고?
[그림4]의 파란색박스에 있는 urldecode함수를 실행하면❓

[그림6]과 같이 응답이 오네요!!
3. HIGH
(1) 대응방안

htmlspecialchars함수는
", ', &, <, >을 UTF-8로 변환해요.
'Wargame > BeeBox' 카테고리의 다른 글
Beebox[OS Command Injection] (0) | 2021.03.29 |
---|---|
Beebox[iFrame Injection] (0) | 2021.03.29 |
Beebox[HTML Injection - Stored (Blog)] (0) | 2021.03.29 |
Beebox[HTML Injection - Reflected (URL)] (0) | 2021.03.29 |
Beebox[HTML Injection - Reflected (GET)] (0) | 2021.03.27 |
댓글