← Back to HWJ CTF

NESTED BASE64 CHALLENGE

Stream-decode a 1.9GB file across 60 nested layers of Base64 encoding.

Tools Used

PythonStreaming I/OBase64

Overview

A massive 1.9GB text file is heavily nested in Base64 encoding. Standard full-file string decoding exhausts RAM.

Reconnaissance

Inspect file encoding; write a chunked streaming decoder processing 16MB blocks to maintain low memory usage (~50MB).

Exploitation Strategy

After 60 streaming iterations, file size shrinks from 1.9GB down to 27 bytes, revealing the flag.

Solution Code

import base64, os
# Stream chunked buffer decoder across 60 iterations
# Output: hwj{1t_w4s_th3_fl4g_2a2f39}

Flag

hwj{1t_w4s_th3_fl4g_2a2f39}