본문 바로가기
Wargame

Dreamhack CTF Season 3 Round #4 (🌱Div2)

by m_.9m 2023. 7. 24.

1. Flying Chars

풀이: [Disable JavaScript] > Style 제거

2. ROT128

풀이: 파이썬으로 복호화

 

[코드]

hex_list = [(hex(i)[2:].zfill(2).upper()) for i in range(256)]

with open('encfile', 'r', encoding='utf-8') as f:
    enc_list = f.read()

enc_list = [enc_list[i:i+2] for i in range(0, len(enc_list), 2)]

plain_list = list(range(len(enc_list)))

for i in range(len(enc_list)):
    hex_b = enc_list[i]
    index = hex_list.index(hex_b)
    plain_list[i] = hex_list[(index - 128) % len(hex_list)]

plain_s = bytes.fromhex(''.join(plain_list))

with open('flag.png', 'wb') as f:
    f.write(plain_s)

'Wargame' 카테고리의 다른 글

[LOS] 20번 dragon 문제 풀이  (0) 2022.02.03
[LOS] 19번 xavis 문제 풀이  (0) 2022.01.25
[LOS] 18번 nightmare 문제 풀이  (0) 2022.01.23
[LOS] 17번 zombie_assassin 문제 풀이  (0) 2022.01.21
[LOS] 16번 succubus 문제풀이  (0) 2022.01.19