Up to Date

Points Difficulty Category
100 Beginner Misc

Description

Our newly hired developer at our company seems to be big on vibe coding, and asked Claude Sonnet to generate some Zen-C code in a moment of hurried inspiration. They attempted to send this code over our system, but it seems like something went wrong with the transmission, resulting in custom TCP payloads! The code got split up into multiple chunks, and some network noise has been mixed in with the transmission. Luckily, they’ve done some preliminary analysis of the packets and determined how the valid and noise packets were transmitted and given you their annotations. Unfortunately though, we aren’t exactly Up To Date with what the new generation is up to today, so we leave the decoding task to you. Filter the noise, reverse the custom protocol, and analyze the Zen-C source code.

Objective

The objective was to recover the hidden flag from a set of provided files: chall.py and output.txt

Flag Format

The flag format will either be: SVBRG{This_is_a_Flag} or SVIBGR{This_is_a_Flag}

Tools Used

Methodology

The first step included analyzing the file chall.py to understand how the secret was hidden. To open the python file, I right clicked and opened the file with a text editor.

Chall graphic

I discovered the chall.py file included secret text split into five chunks and each chunk was wrapped was in a packet starting with a Magic Header (ZN), followed by a Sequence (Seq) number, and the Length (Len) of the data. It seems like the script added fake noise to the file to confuse the search tools.

Since the challenge also included a file called solve.py, I took a look at it to better understand how the packets were being reconstructed.

I used the Python script, solve.py to recover the flag, which scanned the output.txt file for the ZN magic bytes.

Chall graphic

It also checked if the packet started with the correct Sequence ID and placed the chunks back together in the proper order. A piece of code was recovered in a fictional language called Zen-C.

Chall graphic

The recovered Zen-C code revealed an XOR Cipher that used a single key (0x42)and the flag was revealed!

Flag graphic

Flag

SVIBGR{z3n_c_v1b3_da7a_gr4m}

Key Lessons

MITRE ATT&CK

Reflections | Suggestions | What was the Attacker Doing?

This challenge required reconstructing fragmented data and decoding an XOR protected payload to recover the hidden information.

Field Details
ID T1140
Tactic Defense Evasion
Mitigation Review scripts and encoded files for hidden or obfuscated content. Analyze suspicious files inn controlled environment before execution.
Detection Strategy Monitor for tools, scripts, or processes that decode, deobfuscate, or reconstruct encoded information from files.

Source: https://attack.mitre.org