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

[dreamhack] - [reversing | rev-basic-2]

by EunBird 2022. 5. 30.

https://dreamhack.io/wargame/challenges/16/

 

rev-basic-2

Reversing Basic Challenge #2 ์ด ๋ฌธ์ œ๋Š” ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ฌธ์ž์—ด ์ž…๋ ฅ์„ ๋ฐ›์•„ ์ •ํ•ด์ง„ ๋ฐฉ๋ฒ•์œผ๋กœ ์ž…๋ ฅ๊ฐ’์„ ๊ฒ€์ฆํ•˜์—ฌ correct ๋˜๋Š” wrong์„ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์ด ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. ํ•ด๋‹น ๋ฐ”์ด๋„ˆ๋ฆฌ๋ฅผ ๋ถ„์„ํ•˜์—ฌ correct๋ฅผ ์ถœ

dreamhack.io

 

์‚ฌ์šฉ์ž๊ฐ€ ์–ด๋–ค ๊ฐ’์„ ์ž…๋ ฅํ–ˆ์„ ๋•Œ,

ํ•ด๋‹น ์ž…๋ ฅ๊ฐ’์— ๋”ฐ๋ผ

correct ํ˜น์€ wrong ์ด ์ถœ๋ ฅ๋˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ๋ฆฌ๋ฒ„์‹ฑํ•˜์—ฌ

correct๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ๊ฐ’์„ ์ฐพ์•„๋‚ด๋Š” ๋ฌธ์ œ์ด๋‹ค.

 

 

shift+F12๋ฅผ ํ†ตํ•ด ๋ฌธ์ž์—ด์„ ๊ฒ€์ƒ‰ํ•ด๋ณธ๋‹ค.

Corect , Wrong ๋“ฑ์˜ ๋ฌธ์ž๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

 

 

Correct ๋ฌธ์ž๋ฅผ ๋”๋ธ”ํด๋ฆญํ•˜์—ฌ ๋”ฐ๋ผ๊ฐ€๋ณธ๋‹ค.

 

 

X ๋‹จ์ถ•ํ‚ค๋ฅผ ํ†ตํ•ด ํ•ด๋‹น ํ•จ์ˆ˜ ๋ฐ ๋ณ€์ˆ˜๊ฐ€ ์ฐธ์กฐ๋˜๋Š” ์˜์—ญ์„ ์žฌ์ฐธ์กฐํ•œ๋‹ค.

 

 

๋”๋ธ”ํด๋ฆญํ•˜์—ฌ ์ „์ฒด ๊ทธ๋ž˜ํ”„๋ฅผ  ํ™•์ธํ•ด๋ณธ๋‹ค.

 

 

F5 ํ‚ค๋ฅผ ํ†ตํ•ด ๋ฆฌ๋ฒ„์Šค๋””๋ฒ„๊น… ํ•œ๋‹ค.

 

 

์ด๋•Œ, IDA์—์„œ ๋ฆฌ๋ฒ„์Šค๋””๋ฒ„๊น…ํ•œ c์ฝ”๋“œ์—์„œ

printf ์™€ scanf ๋กœ ๋ณด์ด๋Š” ํ•จ์ˆ˜๋ฅผ

๋‹จ์ถ•ํ‚คN์„ ํ†ตํ•ด ์ด๋ฆ„์„ ๋ฐ”๊ฟ”์ฃผ์—ˆ๋‹ค.

 

๋˜ํ•œ, if ๋ฌธ์˜ ์กฐ๊ฑด๋ฌธ์—

sub_7FF65D101000 ๋ผ๋Š” ํ•จ์ˆ˜๊ฐ€ ์กด์žฌํ•˜๋Š”๋ฐ

์ด๋ฅผ ์ž์„ธํžˆ ํ™•์ธํ•ด๋ณด์ž.

 

 

sub_7FF65D101000 ํ•จ์ˆ˜ ๋‚ด๋ถ€

for๋ฌธ์„ 0x12 ๋ฒˆ , ์ฆ‰, 10์ง„์ˆ˜๋กœ๋Š” 18๋ฒˆ ๋Œ๋ฆฐ๋‹ค.

์ด๋•Œ, if ๋ฌธ์„ ์ž์„ธํžˆ ๋ณด๋ฉด

aC ๋ผ๋Š” ์ฃผ์†Œ๋ฅผ ์‚ฌ์šฉ์ž์˜ ์ž…๋ ฅ๊ฐ’๊ณผ ๋น„๊ตํ•˜๊ณ  ์žˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

 

aC ์ฃผ์†Œ์— ์žˆ๋Š” ๋ฌธ์ž๋ฅผ ํ™•์ธํ•˜์—ฌ ๋ณด์ž.

 

 

aC ์ฃผ์†Œ๋ถ€ํ„ฐ 4๊ฐœ์”ฉ 18๋ฒˆ ๋’ค ๊นŒ์ง€ flag๊ฐ€ ์žˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

 

๋”ฐ๋ผ์„œ flag ๋Š” Comp4r3_the_arr4y ์ด๋‹ค.

728x90

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

[ dreamhack ] - [ reversing | rev-basic-7]  (0) 2022.06.01
[ dreamhack ] - [ reversing | rev-basic-6]  (0) 2022.05.31
[ dreamhack ] - [ reversing | rev-basic-5 ]  (0) 2022.05.31
[ dreamhack ] - [ reversing | rev-basic-4 ]  (0) 2022.05.30
reversing | [CodeEngn] Malware L07  (0) 2022.05.30

๋Œ“๊ธ€