← Back to Writeups
CUSTOMEasyReversing

mixer

XESXOR9/10/20261 min read
#reversing#custom#easy#string_analysis#substitution_cipher_reversal

mixer

Platform: rev-kids20.forkbomb.ru | Category: Reversing | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-03-23 | Status: Solved Techniques: string_analysis, substitution_cipher_reversal

Summary

Task: 64-bit ELF binary with substitution cipher validation. Solution: reverse the character mapping by finding indices in the substitution table.

mixer — Reverse Kids 2.0

Description

A binary "mixer" that asks for a key and checks if it's correct. The binary was re-uploaded on 23 Mar with a bug fix.

64-bit ELF binary that validates user input against an expected encrypted string using a substitution cipher.

Analysis

The binary is a 64-bit ELF, not stripped, containing a modify function and main.

Key strings extracted:

  • Alphabet: abcdefghijklmnopqrstuvwxyz_{}0123456789
  • Substitution mapping: wmf9slha2r}v7te_13kby8ug4c{oz5j0idp6nqx
  • Expected encrypted result: k_mfblobadb{udp{idp4{iaxz ‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍

The modify function implements a simple substitution cipher:

  1. For each character in the input
  2. Find its index in the alphabet string
  3. Replace it with the character at the same index in the mapping string
  4. Compare result with strcmp against the expected string

Solution

To reverse the cipher: for each character in the expected string, find its index in the mapping string, then look up the character at that index in the alphabet string.

python
#!/usr/bin/env python3
alphabet = 'abcdefghijklmnopqrstuvwxyz_{}0123456789'
mapping  = 'wmf9slha2r}v7te_13kby8ug4c{oz5j0idp6nqx'
target   = 'k_mfblobadb{udp{idp4{iaxz'
‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍

flag = ''
for c in target:
    idx = mapping.index(c)
    flag += alphabet[idx]

print(flag)  # spbctf{REDACTED}

‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍