https://dreamhack.io/wargame/challenges/1846
Ctrl-C
DescriptionCopy it if you can!플래그의 형식은 WaRP{...}입니다.
dreamhack.io

생성된 서버에 들어가보면 이렇게 황당한 페이지를 볼 수 있다.
copy it if you can이라고 되어있는 것을 보니 아마 긁어서 복사하는 것을 막아둔 것 같다.

개발자 도구 창을 열어서 문자열을 얻을 수 있었다.
일단 문자열을 복사해서 따로 저장해두고 코드를 살펴보았다.
import hashlib
import base64
# 바이트를 정수로 바꾸는 함수
def bytes_to_long(a):
return int.from_bytes(a, byteorder='big')
# 최종적으로 결과를 바이트로 바꿔서 출력
def long_to_bytes(a):
return a.to_bytes((a.bit_length()+7)//8, byteorder='big')
print(long_to_bytes(548488142063681088110499188198346596132432266189304030893626^bytes_to_long(base64.b64encode(hashlib.sha256(input().rstrip().encode('utf-8')).digest())[13:36])))

이렇게 제공된 코드를 실행시키고 복사한 문자열을 넣어주면 플래그가 출력된다.
'해킹 스터디' 카테고리의 다른 글
| [DreamHack] easy-login (2) | 2025.07.24 |
|---|---|
| [DreamHack] Small Counter (0) | 2025.07.23 |
| [DreamHack] Addition calculator (1) | 2025.07.23 |
| [DreamHack] curling (1) | 2025.07.12 |
| [DreamHack] baby-ai (0) | 2025.06.30 |
