λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
βœ’οΈ Miscellaneous (Misc)/Dreamhack

[Dreamhack] 64se64 λ“œλ¦Όν•΅ μ›Œκ²Œμž„ 문제 풀이

by A Lim Han 2023. 8. 19.

πŸ‘’ 64se64 λ“œλ¦Όν•΅ μ›Œκ²Œμž„ 문제 풀이

1.  λ¬Έμ œμ— λŒ€ν•œ μ„€λͺ… μˆ™μ§€ (문제 νŒŒμΌμ€ 별도 λ‹€μš΄λ‘œλ“œ ν•„μš” X)

2.  μ„œλ²„ 생성 ν›„ μ•ˆλ‚΄λœ 링크둜 접속

 

3.  F12 단좕킀λ₯Ό 톡해 개발자 도ꡬ μ‹€ν–‰  -->  Sources νƒ­μ—μ„œ μ†ŒμŠ€ μ½”λ“œ 확인

 

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Welcome</title>
</head>

<body>
  <h1>Welcome! πŸ‘‹</h1>
  <form method="POST">
    <input type="hidden" name="64se64_encoding" value="IyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwphc2M9WzY4LCA3MiwgMTIzLCA5OCwgMTAxLCA0OCwgNTIsIDU0LCA5OCwgNTUsIDUzLCA1MCwgNTAsIDk3LCA5NywgNTAsIDEwMSwgNTAsIDU2LCAxMDIsIDUwLCA1NSwgNTQsIDEwMSwgNDgsIDk5LCA1NywgNDksIDQ4LCA1MywgNTAsIDQ5LCAxMDIsIDUwLCA1MSwgOTcsIDQ4LCA1MywgNTYsIDU1LCA0OCwgNDgsIDUzLCA5NywgNTYsIDUxLCA1NSwgNTUsIDUxLCA1NSwgNDgsIDk3LCA0OSwgNDksIDEwMSwgNTMsIDEwMSwgNTIsIDEwMCwgOTksIDQ5LCA1MywgMTAyLCA5OCwgNTAsIDk3LCA5OCwgMTI1XQphcnI9WzAgZm9yIGkgaW4gcmFuZ2UoNjgpXQpmb3IgaSBpbiByYW5nZSgwLDY4KToKICAgIGFycltpXT1jaHIoYXNjW2ldKQpmbGFnPScnLmpvaW4oYXJyKQpwcmludChmbGFnKQ==">
  </form>
</body>
</html>

4.  value λ³€μˆ˜ 속 base64둜 μΈμ½”λ”©λœ λ¬Έμžμ—΄ 해독을 μœ„ν•œ 슀크립트 μž‘μ„± 

import base64

encoded_data = "IyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwphc2M9WzY4LCA3MiwgMTIzLCA5OCwgMTAxLCA0OCwgNTIsIDU0LCA5OCwgNTUsIDUzLCA1MCwgNTAsIDk3LCA5NywgNTAsIDEwMSwgNTAsIDU2LCAxMDIsIDUwLCA1NSwgNTQsIDEwMSwgNDgsIDk5LCA1NywgNDksIDQ4LCA1MywgNTAsIDQ5LCAxMDIsIDUwLCA1MSwgOTcsIDQ4LCA1MywgNTYsIDU1LCA0OCwgNDgsIDUzLCA5NywgNTYsIDUxLCA1NSwgNTUsIDUxLCA1NSwgNDgsIDk3LCA0OSwgNDksIDEwMSwgNTMsIDEwMSwgNTIsIDEwMCwgOTksIDQ5LCA1MywgMTAyLCA5OCwgNTAsIDk3LCA5OCwgMTI1XQphcnI9WzAgZm9yIGkgaW4gcmFuZ2UoNjgpXQpmb3IgaSBpbiByYW5nZSgwLDY4KToKICAgIGFycltpXT1jaHIoYXNjW2ldKQpmbGFnPScnLmpvaW4oYXJyKQpwcmludChmbGFnKQ=="

decoded_data = base64.b64decode(encoded_data).decode('utf-8')

print(decoded_data)

5.  Google Colabμ—μ„œ μž‘μ„±ν•œ μ½”λ“œ μ‹€ν–‰  -->  λ””μ½”λ“œ κ²°κ³Ό μƒˆλ‘œμš΄ Python μ½”λ“œ 발견

 

#!/usr/bin/env python3
asc=[68, 72, 123, 98, 101, 48, 52, 54, 98, 55, 53, 50, 50, 97, 97, 50, 101, 50, 56, 102, 50, 55, 54, 101, 48, 99, 57, 49, 48, 53, 50, 49, 102, 50, 51, 97, 48, 53, 56, 55, 48, 48, 53, 97, 56, 51, 55, 55, 51, 55, 48, 97, 49, 49, 101, 53, 101, 52, 100, 99, 49, 53, 102, 98, 50, 97, 98, 125]
arr=[0 for i in range(68)]
for i in range(0,68):
    arr[i]=chr(asc[i])
flag=''.join(arr)
print(flag)

6.  μ–»μ–΄λ‚Έ μƒˆ μ½”λ“œ μ‹€ν–‰  -->  FLAG 발견 

#!/usr/bin/env python3
asc=[68, 72, 123, 98, 101, 48, 52, 54, 98, 55, 53, 50, 50, 97, 97, 50, 101, 50, 56, 102, 50, 55, 54, 101, 48, 99, 57, 49, 48, 53, 50, 49, 102, 50, 51, 97, 48, 53, 56, 55, 48, 48, 53, 97, 56, 51, 55, 55, 51, 55, 48, 97, 49, 49, 101, 53, 101, 52, 100, 99, 49, 53, 102, 98, 50, 97, 98, 125]
arr=[0 for i in range(68)]
for i in range(0,68):
    arr[i]=chr(asc[i])
flag=''.join(arr)
print(flag)