ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Webhacking.kr :: old-19๋ฒˆ
    SECURITY/Webhacking 2021. 2. 2. 10:47

    ์ด ๋ฌธ์ œ๋Š”..์ด๋ ‡๊ฒŒ ์ƒ๊ฒผ๋‹ค.

    admin ์จ์žˆ๋Š”๋Œ€๋กœ ๊ทธ๋ƒฅ ์ œ์ถœ ๋ˆŒ๋Ÿฌ๋ณด๋‹ˆ admin ์ด ์•„๋‹ˆ๋ผ๊ณ  ํ•œ๋‹ค.

    ๊ทธ๋ž˜์„œ guest ๋ฅผ ์ž…๋ ฅํ–ˆ๋”๋‹ˆ hello guest ๊ฐ€ ๋œฌ๋‹ค.

    logout ์„ ๋ˆŒ๋Ÿฌ๋ด๋„ ์•„๋ฌด๋Ÿฐ ๋ณ€ํ™”๊ฐ€ ์—†๋‹ค.

     

     

    ์ฟ ํ‚ค๋กœ ์‚ฌ์šฉ์ž๋ฅผ ํ™•์ธํ•˜๋Š” ๊ฒƒ ๊ฐ™์•„์„œ ์ฟ ํ‚ค๋ฅผ ํ™•์ธํ•ด๋ณด๋‹ˆ, ์—ญ์‹œ userid ๊ฐ’์ด ์ƒ์„ฑ๋˜์–ด ์žˆ์—ˆ๋‹ค.

    ์ด ๊ฐ’์„ admin ์˜ ๊ฐ’์œผ๋กœ ๋„ฃ์–ด์ฃผ๋ฉด ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•˜๋‹ค.

     

    ๊ทธ๋Ÿฌ๊ธฐ ์œ„ํ•ด์„  ์—ญ์‹œ ์–ด๋–ป๊ฒŒ ์ด ์ฟ ํ‚ค ๊ฐ’์„ ์ธ์ฝ”๋”ฉํ•œ๊ฑด์ง€ ์•Œ์•„์•ผ๋˜๋Š”๋ฐ, ์ผ๋‹จ ๋’ค์— %3D ๊ฐ€ ๋ถ™์€๊ฑด = ์„ ํผ์„ผํŠธ ์ธ์ฝ”๋”ฉํ•œ ๊ฒƒ์ด๋‹ˆ base64 ๋กœ ์ธ์ฝ”๋”ฉ๋˜์—ˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

     

    ๊ทธ๋ž˜์„œ base64 ๋กœ ๋””์ฝ”๋”ฉ ํ•ด๋ณด์•˜์ง€๋งŒ ์—ฌ์ „ํžˆ ์•Œ ์ˆ˜ ์—†๋Š” ๊ฐ’์ด์–ด์„œ.. ํ•ด์‹œ๊ฐ€ ์“ฐ์˜€๊ตฌ๋‚˜ ์‹ถ์—ˆ๋‹ค.

    ๊ธธ์ด๋ฅผ ๋ณด๋‹ˆ md5 ๊ฐ™์•„์„œ guest ๋ฅผ ๋„ฃ์–ด๋ดค์ง€๋งŒ ์ „ํ˜€ ๋‹ค๋ฅธ ๊ฐ’.

    g ๋ฅผ ๋„ฃ์–ด๋ณด๋‹ˆ base64 ๋””์ฝ”๋”ฉ์„ ํ•œ ๊ฐ’์˜ ์•ž๋ถ€๋ถ„๊ณผ ์ผ์น˜ํ•จ์„ ์•Œ ์ˆ˜ ์žˆ์—ˆ๋‹ค.

    md5(g) = b2f5ff47436671b6e533d8dc3614845d

    ์ฟ ํ‚ค๋ฅผ base64 ๋””์ฝ”๋”ฉํ•œ ๊ฐ’ = b2f5ff47436671b6e533d8dc3614845d7b774effe4a349c6dd82ad4f(์ค‘๋žต)

     

    ๊ฒฐ๊ตญ g u e s t ๋ฅผ ํ•œ ๊ธ€์ž์”ฉ md5 ํ•ด์‹œ๊ฐ’์„ ๋งŒ๋“ค๊ณ , ์ด๊ฑธ base64 ์ธ์ฝ”๋”ฉํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ฟ ํ‚ค ๊ฐ’์ด ๋งŒ๋“ค์–ด์ง„ ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

     

    ์›๋ž˜ ๊ฐ’ -> md5 -> base64 -> url encode == ์ฟ ํ‚ค ๊ฐ’

     

    ๊ทธ๋ž˜์„œ a d m i n ์˜ md5 ๋ฅผ ํ•˜๋‚˜์”ฉ ๊ตฌํ•ด์„œ base64 ์ธ์ฝ”๋”ฉ์„ ํ•ด์„œ ๋„ฃ์–ด์ฃผ์—ˆ๋‹ค.

     

    ๊ทธ๋Ÿฐ๋ฐ error ๊ฐ€ ๋– ์„œ ๋ญ์ง€? ์‹ถ์€ ๋งˆ์Œ์— ๋กœ๊ทธ์ธ ํ™”๋ฉด์—์„œ admi ๋ฅผ ์ž…๋ ฅํ•ด๋ณด์•˜๋‹ค.

    admin ์ด ์•„๋‹ˆ๋‹ˆ ๋กœ๊ทธ์ธ์ด ๋˜์–ด์„œ ์ฟ ํ‚ค๋ฅผ ๋ณด๋‹ˆ, ๋‚ด๊ฐ€ ๊ตฌํ•œ ์ฟ ํ‚ค๊ฐ’๊ณผ๋Š” ๋ฏธ์„ธํ•˜๊ฒŒ ๋‹ฌ๋ž๋‹ค.

    ๋‚ด๊ฐ€ ๊ตฌํ•œ ๊ฐ’: MENDMTc1QjlDMEYxQjZBODMxQzM5OUUyNjk3NzI2NjE4 (์ค‘๋žต)

    admi ์˜ ์ฟ ๊ธฐ ๊ฐ’: MGNjMTc1YjljMGYxYjZhODMxYzM5OWUyNjk3NzI2NjE4Mjc3ZTA5M (์ค‘๋žต)

     

     

    ๋ญ”๊ฐ€ ์‹ถ์–ด์„œ ๋ดค๋”๋‹ˆ md5(a) = 0CC175B9C0F1B6A831C399E269772661 ์ธ๋ฐ ์ด๊ฑธ ๊ทธ๋Œ€๋กœ base64 ์ธ์ฝ”๋”ฉํ•˜๋‹ˆ๊นŒ ๊ฐ’์ด ๋‹ฌ๋ž๋˜ ๊ฒƒ์ด๋‹ค.

    ์ฆ‰, ์•ŒํŒŒ๋ฒณ ๋Œ€๋ฌธ์ž๋ผ์„œ....

    md5(a) = 0cc175b9c0f1b6a831c399e269772661 ์™€ ๊ฐ™์ด ์†Œ๋ฌธ์ž๋กœ base64 ์ธ์ฝ”๋”ฉํ•ด์•ผ ํ•œ๋‹ค.

    ์ด๊ฑธ ๋‹ค ๊ตฌํ•˜๊ณ  ๋งˆ์ง€๋ง‰ == ์€ %3D%3D ๋กœ ๋ฐ”๊พธ์–ด ์ฟ ํ‚ค ๊ฐ’์— ๋„ฃ์œผ๋‹ˆ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์™”๋‹ค. ๋!

     

     

    ๋Œ“๊ธ€

Designed by Tistory.