Nava - ASIS CTF Reverse Challenge
Nava - ASIS CTF Reverse Challenge
Platform: CUSTOM | Category: Reversing | Type: Challenge | Difficulty: Medium | OS: N/A | **Author: XESXOR Techniques: Reversing
Summary
Walkthrough of the CUSTOM Reversing Nava - ASIS CTF Reverse Challenge. Task: extract a flag from a binary that transforms a 400x80 bitmap. Solution: count 1-pixels per column in the input bitmap, group by 8 columns, divide sums by 8, XOR with 0xFF to get ASCII characters
Information
- Event: ASIS CTF
- Task: Nava
- Category: reverse
- Format: ASIS{...}
- Difficulty: Medium
- Solved: Yes
Description
"visualization isn't modern art, so stop admiring it, reverse the pixels, and extract the secret flag now!"
Files
Nava.txz- Archive containing:nava- 64-bit ELF stripped binaryoutput- Input bitmap (400 lines × 80 chars of 0/1)font_*.txt- 80x80 pixel representations of characters (0-9, A-Z, _, {, })
Solution
Analysis
The binary takes a 400×80 bitmap as input and transforms it into a 518,400×80 output (1296× expansion per row). However, the flag is encoded directly in the input bitmap structure.
Key Insight
The input bitmap encodes the flag by counting '1' pixels in column groups of 8:
- Count total '1's in each of the 80 columns
- Group columns by 8 and sum each group (10 groups total)
- Divide each sum by 8
- XOR each value with 0xFF to get ASCII character code
- Filter out non-printable ASCII (padding)
- Result is the flag content
Column Group Pattern
| Columns | Sum | ÷8 | XOR 0xFF | Char |
|---|---|---|---|---|
| 0-7 | 0 | 0 | 255 | ÿ (padding) |
| 8-15 | 1216 | 152 | 103 | g |
| 16-23 | 1344 | 168 | 87 | W |
| 24-31 | 1408 | 176 | 79 | O |
| 32-39 | 1280 | 160 | 95 | _ |
| 40-47 | 1088 | 136 | 119 | w |
| 48-55 | 1408 | 176 | 79 | O |
| 56-63 | 1344 | 168 | 87 | W |
| 64-71 | 1216 | 152 | 103 | g |
| 72-79 | 0 | 0 | 255 | ÿ (padding) |
Result
- Decoded string:
gWO_wOWg - Flag:
ASIS{REDACTED}
Solve Script
python read-only • copy allowed#!/usr/bin/env python3 def solve(): with open('output', 'r') as f: lines = f.readlines() # Count 1s per column col_counts = [0] * 80 for line in lines: for i, c in enumerate(line.strip()): if c == '1': col_counts[i] += 1 # Group by 8 columns and decode result = [] for i in range(0, 80, 8): group_sum = sum(col_counts[i:i+8]) value = group_sum // 8 decoded = value ^ 0xFF if 32 <= decoded <= 126: # Printable ASCII result.append(chr(decoded)) print(f"ASIS{{{''.join(result)}}}")
Key Observations
- The column values form a symmetric pattern:
[0, 152, 168, 176, 160, 136, 176, 168, 152, 0] - The first and last groups (value 0) are padding and should be excluded
- XOR with 0xFF is the key transformation to get readable ASCII
- The font files (80×80 pixel representations) show that character complexity varies, but are not directly used in decoding
Tags
- reverse
- pixel counting
- xor encoding
- bitmap analysis
Key Takeaways / Lessons
- Mastering Reversing was key to this challenge.
- Always check for common misconfigurations and verify assumptions.
Crafted by XESXOR Research • 2025-12-28 • CUSTOM • Nava - ASIS CTF Reverse Challenge • Difficulty: Medium