Converter
Converter
Platform: spbctf | Category: pwn | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-03-11 | Status: Solved Techniques: ascii_art_parsing, automated_interaction, number_format_conversion, struct_packing
Summary
Task: answer ~112 number format conversion questions (hex, octal, big/little endian 64-bit) presented with ASCII art format names. Solution: automate parsing of format names and numbers, then respond with hex/oct string representations or struct-packed binary for endian formats.
Converter — SPB CTF Pwn Season
Description
"Конвертируйте числа в разные форматы"
(Convert numbers to different formats)
Server: nc 109.233.56.90 11573
Binary: None provided (black-box)
Points: 10
Analysis
The server sends numbers and asks to convert them to different formats displayed as ASCII art: Hex, Octal, Big Endian 64, Little Endian 64.
Format Requirements:
- Hex/Octal: Send string representation (e.g., "0xff", "0o377")
- Big Endian 64: Send raw packed bytes using
struct.pack('>Q', num) - Little Endian 64: Send raw packed bytes using
struct.pack('<Q', num)
Must answer approximately 112 questions correctly.
Solution
python read-only • copy allowedfrom pwn import * import struct io = remote('109.233.56.90', 11573) def parse_ascii_art(data): # Pattern matching for ASCII art format names if b'HEX' in data: return 'hex' elif b'OCT' in data: return 'octal' elif b'BIG' in data: return 'big' elif b'LITTLE' in data: return 'little' return None for _ in range(112): data = io.recvuntil(b'Answer: ') # Extract number from output num = int(io.recvline().strip()) # Determine format from ASCII art fmt = parse_ascii_art(data) if fmt == 'hex': io.sendline(hex(num).encode()) elif fmt == 'octal': io.sendline(oct(num).encode()) elif fmt == 'big': io.send(struct.pack('>Q', num)) elif fmt == 'little': io.send(struct.pack('<Q', num)) io.interactive()