๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Welcome.
:: DreamHack ๐Ÿšฉ/wargame - web

[ dreamhack ] - [ web | simple sqli ]

by EunBird 2022. 3. 15.

์ ‘์†ํ•˜๋ฉด ์œ„์™€ ๊ฐ™์€ ํŽ˜์ด์ง€๊ฐ€ ๋‚˜์˜จ๋‹ค.


๋ฌธ์ œ๊ฐ€ simple sqli ์ธ ๊ฒƒ์œผ๋กœ ๋ด์„  ๋กœ๊ทธ์ธ ์ฐฝ์—์„œ ๊ฐ’์„ ์ž…๋ ฅํ•˜์—ฌ flag๋ฅผ ์–ป์–ด๋‚ด๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค.

 ๋”ฐ๋ผ์„œ ์œ„์ฒ˜๋Ÿผ guest/guest ๋กœ ์ž…๋ ฅํ•˜์—ฌ ๋กœ๊ทธ์ธ์ด ๊ฐ€๋Šฅํ•œ์ง€ ํ™•์ธํ•˜์—ฌ ๋ณด๊ฒ ๋‹ค.

 


guest/guest๋กœ ๋กœ๊ทธ์ธ์ด ๊ฐ€๋Šฅํ•œ ๊ฒƒ์„ ํ™•์ธํ•˜์˜€๋‹ค.


์ด ์‚ฌ์ดํŠธ๊ฐ€ ์–ด๋–ค db๋ฅผ ์“ฐ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ์‹ฑ๊ธ€ ์ฟผํ„ฐ๋ฅผ ๋„ฃ์–ด์„œ ์‹œ๋„ํ•ด ๋ณด๊ฒ ๋‹ค.

guest' / 1111


์ธ์‹์ด ๋˜์ง€ ์•Š๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.


์ด๋ฒˆ์—” ๋”๋ธ” ์ฟผํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž…๋ ฅํ•ด๋ณด๊ฒ ๋‹ค.

guest" / 1111 ์„ ์ž…๋ ฅํ•˜์—ฌ ๋กœ๊ทธ์ธ ์‹œ๋„.


๋ญ”๊ฐ€ ์„œ๋ฒ„ ๋‚ด๋ถ€์—์„œ ์˜ค๋ฅ˜๋กœ ์ธ์‹ํ•˜์˜€์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

 


์œ„์—์„œ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๊ฐ€ SQL๋ฌธ์ด ๋ฌธ๋ฒ•์ด ํ‹€๋ฆฌ๊ฒŒ ๋งŒ๋“ค์–ด์„œ ๋‚˜์˜จ ์˜ค๋ฅ˜๋ผ๊ณ  ๊ฐ€์ •ํ•œ๋‹ค๋ฉด,

guest" -- 

1111

๋กœ ๋กœ๊ทธ์ธํ•œ๋‹ค๋ฉด ๋’ท ๋ถ€๋ถ„์€ ์ฃผ์„์œผ๋กœ ์ธ์‹ํ•˜๊ธฐ ๋•Œ๋ฌธ์— 

SQL ์ฟผ๋ฆฌ๋ฌธ์˜ ๋ฌธ๋ฒ•์ด ์ •์ƒ์ ์œผ๋กœ ์ž‘์šฉํ•  ๊ฒƒ์ด๋‹ค.


 

๋ฌธ์ œ ์—†์ด guest๋กœ ์˜ฌ๋ฐ”๋ฅธ ๋น„๋ฐ€๋ฒˆํ˜ธ์—†์ด ๋กœ๊ทธ์ธ์— ์„ฑ๊ณตํ–ˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

 




๊ทธ๋ ‡๋‹ค๋ฉด, ๊ฐ™์€ ๋ฐฉ๋ฒ•์œผ๋กœ admin" -- ์™€ ๋ฌด์ž‘์œ„ ๊ฐ’์„ password์— ๋„ฃ์–ด์„œ

์–ด๋“œ๋ฏผ ๊ณ„์ •์œผ๋กœ ๋กœ๊ทธ์ธ์„ ์‹œ๋„ํ•˜์—ฌ ๋ณด๊ฒ ๋‹ค.


๋กœ๊ทธ์ธ์— ์„ฑ๊ณตํ•˜์—ฌ FLAG๋ฅผ ์–ป์—ˆ๋‹ค!!!

 

 

-->

select * from users where userid="{admin" --}" and userpassword="{1111}

 

์ด๋Ÿฐ์‹์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์—ˆ๊ธฐ์— admin" -- ๋ฅผ ์ž…๋ ฅํ•œ ๊ฒฝ์šฐ์— 

๋กœ๊ทธ์ธ์— ์„ฑ๊ณตํ•  ์ˆ˜ ์žˆ์—ˆ๋˜ ๊ฒƒ์ด๋‹ค.

728x90

':: DreamHack ๐Ÿšฉ > wargame - web' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[ dreamhack ] - [ web | proxy-1 ]  (0) 2022.03.17
[ dreamhack ] - [ web | command-injection-1 ]  (0) 2022.03.16
[ dreamhack ] - [web | file download ]  (0) 2022.03.16
[ dreamhack ] - [ web | pathtraversal ]  (0) 2022.03.15
[ dreamhack ] - [ web | cookie]  (0) 2022.03.15

๋Œ“๊ธ€