Каталогический хаос (Catalog Chaos)
Каталогический хаос (Catalog Chaos)
Platform: duckerz | Category: Misc | Type: Challenge | Difficulty: Easy | OS: Linux | Author: XESXOR | Date: 2026-01-09 | Status: Solved Techniques: case_sensitivity_bypass, position_mapping, zip_direct_read
Summary
Task: ZIP archive with single-char folder/file names where case-sensitivity causes extraction issues on macOS. Solution: Read ZIP directly with Python zipfile to extract character positions and build the flag.
Каталогический хаос (Catalog Chaos) — duckerz
Description
"Как можно работать в этом хаосе?!?!?!?!?"
File: catalogy_chaos.zip
Analysis
Archive Structure
When extracting the archive, an unusual structure is revealed:
- Folders with single-character names (letters, digits, special characters
{,},_) - Each folder contains a
.txtfile with the same name - Files contain numbers — positions of the character in the flag
Problem: Case Sensitivity
Key point: On macOS (case-insensitive filesystem) when extracting a ZIP archive, files overwrite each other!
For example:
- The archive contains folder
a/with filea.txt - It also contains folder
A/with fileA.txt - When extracting on macOS, they merge into one folder
The "chaos" in the task name is a hint about the case mismatch between directory and file names.
Approach
Need to read the ZIP archive directly via Python without extracting to the filesystem:
- The character is taken from the filename (not the directory)
- Numbers in the file indicate positions of that character in the flag
Solution
python read-only • copy allowed#!/usr/bin/env python3 """ Catalog Chaos - duckerz CTF Read ZIP directly to avoid case-sensitivity issues """ import zipfile positions = {} with zipfile.ZipFile('catalogy_chaos.zip', 'r') as z: for info in z.infolist(): if info.filename.endswith('.txt'): parts = info.filename.split('/') if len(parts) >= 3: # Take character from filename, not directory char = parts[2].replace('.txt', '') content = z.read(info.filename).decode('utf-8').strip() if content: for line in content.split('\n'): line = line.strip() if line: pos = int(line) positions[pos] = char # Build the flag max_pos = max(positions.keys()) flag = ['?'] * (max_pos + 1) for pos, char in positions.items(): flag[pos] = char print(''.join(flag))
Output
DUCKERZ{REDACTED}
Alternative Approaches
- Linux VM — extract on a case-sensitive filesystem (ext4)
- Docker — use a Linux container for extraction
- Create a case-sensitive partition on macOS (APFS case-sensitive)
Lessons
- Always inspect ZIP contents directly before extraction
- Case-sensitivity — a common trap in CTF tasks
- Python zipfile — a powerful tool for working with archives without extraction