crypto / reverse-engineering / forensics / misc / web

ZeroSecure CTF 2025

0xAvengers CTF writeup covering DTMF audio analysis, binary RE, polyglot decryption, Python bytecode reversing, git forensics, LSB steganography, and more.

September 2025team: 0xAvengersTop 10 inter-campus

DTMF · XOR · AES · radare2 · ghidra · python-bytecode · git-forensics · LSB-steganography · gzip

ZeroSecure CTF 2025

Team: 0xAvengers
Handle: 0xAnon (Wahid Khan)
Event: ZeroSecure CTF, NFSU Inter-Campus
Placement: Top 10


Dialed Secrets (Forensics / Audio)

Category: Forensics (Audio Analysis)

mystery.wav with no speech, only repetitive mechanical tones. Loaded in Audacity, switched to spectrogram view. Saw pairs of frequencies per tone, consistent and structured. Textbook DTMF (Dual-Tone Multi-Frequency).

Steps

  1. Opened in Audacity, confirmed dual-frequency pairs in spectrogram
  2. Ran through a DTMF decoder tool to extract the digit sequence
  3. Grouped the digits into two-digit decimal values (each representing an ASCII character)
  4. Converted to text

DTMF maps each key to a row frequency + column frequency. Pairs like 697Hz+1209Hz = 1, 770Hz+1336Hz = 5, etc. The decoder did the heavy lifting.

Flag: ZeroSecure_CTF{DTMF_SIGNAL_UNLOCKED}


Schrodinger's String (Reverse Engineering)

Category: Reverse Engineering (Static Analysis)

Binary that always prints Access denied. regardless of input. Something is hidden.

$ strings binary | grep -i flag
# nothing useful

Opened in Ghidra. Used the Functions panel to scan for anything that wasn't called from main. Found hidden_flag_builder with no callers.

Inside: a sequence of movb instructions assigning one character at a time to a buffer:

buf[0] = 'Z';
buf[1] = 'e';
buf[2] = 'r';
// ... continues for full flag

Read the bytes in order, combined them.

Flag: ZeroSecure_CTF{schrodinger_stack_fragment}


Polyglot's Dilemma (Crypto)

Category: Cryptography

A single file containing the same data in three formats: hex string, base64, and a C-style uint8_t array. A Python snippet inside revealed key: Natsuki_Subaru_Network. JSON section said XOR.

All three formats decode to the same byte sequence. Chose hex since it was most straightforward.

import binascii

# Extract the hex blob from the file
data = bytes.fromhex("...")

key = b"Natsuki_Subaru_Network"
result = bytes(data[i] ^ key[i % len(key)] for i in range(len(data)))
print(result.decode())

Flag: ZeroSecure_CTF{polyglot_layers_resolve_9}


License Whisper (Reverse Engineering)

Category: Reverse Engineering (Java Bytecode)

.jar file that validates a single license string. Description said the correct input is already in the program.

$ java -jar license.jar
# Enter license: ...
# Invalid

Decompiled with CFR:

$ java -jar cfr.jar license.jar --outputdir out/

Found a method building the expected string from an integer array with transformation:

int[] arr = { 88, 57, 104, 71, 103, ... };
StringBuilder sb = new StringBuilder();
for (int i = 0; i < arr.length; i++) {
    sb.append((char)(arr[i] ^ (17 + (i % 7) * 3)));
}

Replicated in Python:

arr = [88, 57, 104, 71, 103, ...]  # full array from decompiled code
result = "".join(chr(v ^ (17 + (i % 7) * 3)) for i, v in enumerate(arr))
print(result)

Flag: ZeroSecure_CTF{java_bytecode_is_chatty}


Ghost in the Machine (Reverse Engineering)

Category: Reverse Engineering (Python Bytecode)

.pyc file, no source. Used dis to disassemble:

import dis, marshal, struct

with open("ghost.pyc", "rb") as f:
    f.read(16)  # skip header
    code = marshal.load(f)

dis.dis(code)

Disassembly showed:

  1. A hardcoded string constant loaded with LOAD_CONST
  2. LOAD_CONST for slice(None, None, -1) then BINARY_SUBSCR: reversal via [::-1]
  3. A loop incrementing each character's ordinal by 2

Reverse operation: subtract 2 from each char, then reverse the result.

encoded = "..."  # constant from bytecode
decoded = "".join(chr(ord(c) - 2) for c in encoded)[::-1]
print(decoded)

Flag: ZeroSecure_CTF{ghost_opcode_trace_9}


Snapshot Relay (Misc / Logic)

Category: Logic / Code Analysis

Node.js restore controller (select-restore.js, eligibility.js, lease-policy.js, normalize-lease.js) with artifact files (jobs.json, snapshots.json, leases.ndjson, controller.log).

Eligibility rules:

  • flow must equal prod-restore
  • status in [queued, ready]
  • snapshot: tier=gold, region=primary, state=sealed, fabric=braided
  • lease must be trusted and promoted

Evaluated each job in queued_at order:

JobFailure reason
bucket-paradeflow != prod-restore
ember-ferrystatus not in [queued, ready]
cobalt-spansnapshot fabric != braided
radial-lakesnapshot region != primary
violet-spanpasses all checks

violet-span has lease ls-304. Trust check: connector is trusted, alias valid.

Decoded lane label: pd:rs via the decodeLane() function in normalize-lease.js:

function decodeLane(code) {
  const map = { "pd": "prod", "rs": "restore" };
  return code.split(":").map(k => map[k]).join("-");
}
// "pd:rs" -> "prod-restore"

Decoded snapshot alias: em -> ember, vt -> vault. Slug: violet-span-prod-restore-ember-vault

Flag: ZeroSecure_CTF{violet-span-prod-restore-ember-vault}


Git Dangle (Forensics)

Category: Forensics (Git History)

Git repo dump. Current branch showed only clean documentation commits.

$ git log --all --oneline
# only 3 clean commits visible

Checked the reflog for abandoned history:

$ git reflog --all
# feature/secret branch appeared with a transition
# commit 5cf8732: "WIP: sensitive configuration"

5cf8732 is not reachable from any branch but still exists in the object store:

$ git show 5cf8732
# diff shows secret.txt with the flag

Flag: ZeroSecure_CTF{dangling_blobs_never_really_leave_142fe5ba}


LSB Channels (Forensics / Steganography)

Category: Forensics (Image Steganography)

even_odd_channel.png. Standard steghide and zsteg both returned nothing. The filename itself was the hint: even/odd rows, different channels.

Hypothesis: even rows use red channel LSB, odd rows use green channel LSB.

from PIL import Image

img = Image.open("even_odd_channel.png")
pixels = img.load()
w, h = img.size

bits = []
for y in range(h):
    for x in range(w):
        r, g, b = pixels[x, y][:3]
        if y % 2 == 0:
            bits.append(r & 1)   # even rows: red LSB
        else:
            bits.append(g & 1)   # odd rows: green LSB

chars = []
for i in range(0, len(bits) - 7, 8):
    byte = 0
    for bit in bits[i:i+8]:
        byte = (byte << 1) | bit
    if byte == 0:
        break
    chars.append(chr(byte))

print("".join(chars))

Flag: ZeroSecure_CTF{least_significant_bits_whisper_secrets_c3ad26de}


Vessel in Void (Reverse Engineering / Crypto)

Category: Reverse Engineering + Cryptography

vessel.tar.gz containing ELF binary void. strings showed multiple fake flags and a REAL_CIPHERTEXT symbol in .rodata. Binary also derives an AES key from a seed + SHA256 of its own .text section.

The seed was not in the ELF. It was in the gzip extra field of vessel.tar.gz.

Extracting the seed

with open("vessel.tar.gz", "rb") as f:
    header = f.read(10)
    xlen = int.from_bytes(f.read(2), "little")
    extra = f.read(xlen)
    # find VO header, read 48 bytes after it
    idx = extra.index(b"VO") + 4
    seed = extra[idx:idx+48]

Key derivation

import hashlib, struct
from Crypto.Cipher import AES

# Compute SHA256 of .text section
with open("void", "rb") as f:
    elf = f.read()
# locate .text section offset and size from ELF headers
# ...
text_hash = hashlib.sha256(text_section).digest()

key_material = hashlib.pbkdf2_hmac(
    "sha256",
    password=seed[:32],
    salt=text_hash,
    iterations=100000,
    dklen=48
)
aes_key = key_material[:32]
aes_iv  = key_material[32:]

cipher = AES.new(aes_key, AES.MODE_CBC, aes_iv)
pt = cipher.decrypt(real_ciphertext)
print(pt)

Flag: ZeroSecure_CTF{caught_final_void}


DTMF Noise (Forensics / Audio)

Category: Forensics (Noisy DTMF)

Noisy .wav with DTMF tones under white noise. Standard FFT-based DTMF decoders failed because the noise floor was too high.

Used the Goertzel algorithm, which computes power at a specific frequency without doing a full FFT. More robust for detecting single known frequencies in noise.

DTMF uses 4 row frequencies (697, 770, 852, 941 Hz) and 4 column frequencies (1209, 1336, 1477, 1633 Hz).

import numpy as np
from scipy.io import wavfile

def goertzel(samples, target_freq, sample_rate):
    N = len(samples)
    k = int(0.5 + N * target_freq / sample_rate)
    omega = 2 * np.pi * k / N
    coeff = 2 * np.cos(omega)
    s_prev, s_prev2 = 0.0, 0.0
    for s in samples:
        s_curr = s + coeff * s_prev - s_prev2
        s_prev2, s_prev = s_prev, s_curr
    power = s_prev2**2 + s_prev**2 - coeff * s_prev * s_prev2
    return power

ROW_FREQS = [697, 770, 852, 941]
COL_FREQS = [1209, 1336, 1477, 1633]
DTMF_MAP = {
    (0,0):'1',(0,1):'2',(0,2):'3',(0,3):'A',
    (1,0):'4',(1,1):'5',(1,2):'6',(1,3):'B',
    (2,0):'7',(2,1):'8',(2,2):'9',(2,3):'C',
    (3,0):'*',(3,1):'0',(3,2):'#',(3,3):'D',
}

sr, data = wavfile.read("noisy.wav")
data = data.astype(float) / 32768

# Segment high-energy regions, run Goertzel on each
# then map (row_idx, col_idx) to hex digit via 4x4 grid

Combined all digits, converted hex string to ASCII.

Flag: ZeroSecure_CTF{goertzel_dtmf_hex_decoded}

written by wahid khan (@0xAnon)

all writeups