[๋ฌธ์ ]

๊ฒฝ๊ณ ์ฐฝ์ ๋์ฐ๋ ๊ฒ์ด ๋ชฉํ์ ๋๋ค!
XSS GAME_level 2: https://xss-game.appspot.com/level2
https://xss-game.appspot.com/level2
Oops! Based on your browser cookies it seems like you haven't passed the previous level of the game. Please go back to the previous level and complete the challenge.
xss-game.appspot.com
[๋ฌธ์ ํ์ด]

1) ์ฐ์ ๊ฒฝ๊ณ ์ฐฝ์ ๋์๋ณด๋ ค๊ณ <scipt>alert()</script> ํ๊ทธ๋ฅผ ์ด์ฉํด์ ํด๋ณธ ๊ฒฐ๊ณผ ํํฐ๋ง์ด ๋ผ์ ๋ฉ์์ง๊ฐ ๋์์ต๋๋ค.

2) ํํธ๋ฅผ ๋ณด๋ onerror๋ฅผ ์ฌ์ฉํ๋ผ๋ ๊ฒ์ ์๊ฒ ๋์๊ณ , onerror์ ๋ํด ์ฐพ์๋ณด๋ img ํ๊ทธ์ ์ฌ์ฉ๋๊ณ , ์ด๋ฏธ์ง๊ฐ ์์ ๊ฒฝ์ฐ์ ๋จ๋ ์๋ฌ๊ฐ onerror๋ผ๋ ๊ฒ์ ์๊ฒ ๋์์ต๋๋ค!

3) ๊ทธ๋์ img ํ๊ทธ๋ฅผ ํตํด ์ ํจํ์ง ์๋ ์ด๋ฏธ์ง ๋ฃ์ด์ฃผ๊ณ onerror๋ก ๊ฒฝ๊ณ ์ฐฝ์ ๋์ฐ๊ฒ ํ๋ ๋ฐฉ๋ฒ์ผ๋ก ์ ๋ ฅ์ฐฝ์
<img src ="https://example.com/a.jpg" onerror="alert()">์ ๋ ฅ ํ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค!
[TIP]
- ์ด๋ฒคํธ ํธ๋ค๋ฌ๋ ํน์ ์์์์ ๋ฐ์ํ๋ ์ด๋ฒคํธ๋ฅผ ์ฒ๋ฆฌํ๊ธฐ ์ํด ์กด์ฌํ๋ ์ฝ๋ฐฑ ํํ์ ํธ๋ค๋ฌ ํจ์์ด๋ค.
- ์ด๋ฒคํธ ํธ๋ค๋ฌ ๋ด์ XSS ์ ๋ฐ ์ฝ๋๋ฅผ ์ฝ์ ํ๋ฉด ํด๋น ์ด๋ฒคํธ๊ฐ ๋ฐ์ํ์ ๋ XSS๊ฐ ์ํ๋๋ค. ์์ฃผ ์ฌ์ฉ๋๋ ์ด๋ฒคํธ ํธ๋ค๋ฌ ์์ฑ์ onload, onerror, onfocus๊ฐ ์๋ค.
[onerror ์ด๋ฒคํธ ํธ๋ค๋ฌ] : img ํ๊ทธ์ ์ฌ์ฉ๋๊ณ , ์ด๋ฏธ์ง๊ฐ ์์ ๊ฒฝ์ฐ ์๋ฌ
<img src="https://example/com/a.jpg"onerror="alert()">=> ์ ํจํ ์ด๋ฏธ์ง ๋ก๋ ํ onerror ํธ๋ค๋ฌ ์คํ X
=> ์ด๋ฏธ์ง ๋ก๋ ์คํจ ์ onerror ํธ๋ค๋ฌ ์คํ O
[์ฐธ๊ณ ]
[WEB] XSS ์ฐํ #1
XSS ๊ณต๊ฒฉ์ ๋ฐฉ์ดํ๊ธฐ ์ํ ๋ค์ํ ํจ์น์ ํํฐ๋ง์ด ์กด์ฌํ๋ค. ๊ทธ๋ฌ๋ XSS ๋ฐฉ์ด๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ํ๋์ง ์์์ ๋ ์ด๋ฅผ ์ฐํํ ์ ์๋ ๋ฐฉ๋ฒ๋ ๋ค์ํ๋ค. ์ด๋ฒคํธ ํธ๋ค๋ฌ ์์ฑ ์๋ฐ์คํฌ๋ฆฝํธ ์ฝ๋๋ฅผ ์ค
limvo.tistory.com
'๋ณด์ > CTF' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํฌ๋ ์] Angstrom CTF 2022-Shark 2 (0) | 2024.08.20 |
---|---|
[ํฌ๋ ์] Angstrom CTF 2022-Shark 1 (0) | 2024.08.20 |
[์นํดํน] webhacking.kr old-44 (0) | 2024.08.20 |
[์นํดํน] | [๋๋ฆผํต] file-download-1 (0) | 2024.08.20 |
[์นํดํน] | [๋๋ฆผํต] cookie (0) | 2024.08.20 |