← Back to Writeups
CUSTOMEasyMisc

fordata_ru

XESXOR9/2/20262 min read
#misc#custom#easy#codepage_conversion#encoding_mismatch_detection#windows

fordata_ru

Platform: spbctf | Category: Misc | Type: Challenge | Difficulty: Easy | OS: Windows | Author: XESXOR | Date: 2026-03-09 | Status: Solved Techniques: codepage_conversion, encoding_mismatch_detection

Summary

Task: Decode garbled Russian text that appears as nonsensical Cyrillic characters. Solution: Identified KOI8-R vs CP1251 encoding mismatch and re-encoded the text to reveal a phonetically spelled flag.

fordata_ru — Forensics Kids 2.0

Description

Прочтите русский текст: мС ВРН-Ф БШ ЯЛНЦКХ ЛЕМЪ ОПНВХРЮРЭ, СПЮ! бЮЬЮ МЮЦПЮДЮ ГЮ ЩРНР ЙБЕЯР - ЩЯ ОЩ АЩ ЖЩ РЩ ЩТ ТХЦСПМЮЪ ЯЙНАЙЮ БНЯЕЛЭ РПХ ЬЕЯРЭ РПХ РПХ МНКЭ ДЕБЪРЭ ТХЦСПМЮЪ ЯЙНАЙЮ

Analysis

The text looks like Russian (Cyrillic characters), but is completely unreadable. This is a classic sign of encoding mismatch — when text was encoded in one codepage but displayed in another.

For Russian language, the most common issues occur between:

  • KOI8-R — old Unix/Linux encoding
  • CP1251 (Windows-1251) — Windows encoding
  • UTF-8 — modern universal encoding ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Characteristic pattern: text in CP1251 displayed as KOI8-R (or vice versa) produces "inverted" case and shifted letters.

Solution

Step 1: Identifying the mismatch type

Trying various re-encoding combinations:

python
#!/usr/bin/env python3

text = "мС ВРН-Ф БШ ЯЛНЦКХ ЛЕМЪ ОПНВХРЮРЭ, СПЮ! бЮЬЮ МЮЦПЮДЮ ГЮ ЩРНР ЙБЕЯР - ЩЯ ОЩ АЩ ЖЩ РЩ ЩТ ТХЦСПМЮЪ ЯЙНАЙЮ БНЯЕЛЭ РПХ ЬЕЯРЭ РПХ РПХ МНКЭ ДЕБЪРЭ ТХЦСПМЮЪ ЯЙНАЙЮ"

# Text displayed as KOI8-R, but was encoded in CP1251
decoded = text.encode('koi8-r').decode('cp1251')
print(decoded)

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

Step 2: Re-encoding result

Ну что-ж вы смогли меня прочитать, ура!
Ваша награда за этот квест - эс пэ бэ цэ тэ эф фигурная скобка восемь три шесть три три ноль девять фигурная скобка

Step 3: Decoding the phonetic flag representation

The flag is written phonetically in Russian:

  • эс = s
  • пэ = p
  • бэ = b
  • цэ = c
  • тэ = t
  • эф = f
  • фигурная скобка = {
  • восемь = 8
  • три = 3
  • шесть = 6
  • три = 3
  • три = 3
  • ноль = 0
  • девять = 9
  • фигурная скобка = } ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍