← Back to Writeups
CUSTOMEasyMisc

Clockmaker

XESXOR9/2/20262 min read
#misc#custom#easy#base12_pair_decoding#emoji_to_number_mapping#html_entity_decoding

Clockmaker

Platform: hackerlab | Category: Misc | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-04-04 | Status: Solved Techniques: base12_pair_decoding, emoji_to_number_mapping, html_entity_decoding

Summary

Task: a text file contains HTML numeric entities that decode into Unicode clock-face emojis, plus a hint about time. Solution: map each clock emoji to its hour value, read pairs as base-12 numbers, and convert them into ASCII to recover the flag.

Clockmaker — hackerlab

Description

«Какой сейчас час, не подскажешь?»

English summary: the provided ZIP archive contains task.txt filled with HTML numeric entities. After decoding them, the payload becomes a sequence of clock-face emojis that must be interpreted to recover the flag.

Analysis

The file contents are numeric HTML entities such as 🕔. Decoding them produces only clock-face emojis from 🕐 to 🕛, which immediately suggests using their hour values as numbers.

There are 12 possible clock symbols, so the natural mapping is: ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

  • 🕐 = 1
  • 🕑 = 2
  • ...
  • 🕛 = 12

The hint asks for the current time, reinforcing that each symbol should be treated as an hour number. Reading the values one by one does not make sense directly, but grouping them in pairs gives base-12 numbers that convert cleanly into printable ASCII.

For example:

  • 🕔 🕖 → 5 * 12 + 7 = 67 → C
  • 🕕 🕖 → 6 * 12 + 7 = 79 → O
  • 🕔 🕗 → 5 * 12 + 8 = 68 → D

This quickly reveals the prefix CODEBY{.

Solution

  1. Extract task.txt from the provided ZIP archive.
  2. Decode the HTML entities in task.txt into Unicode characters.
  3. Split the resulting string into individual clock emojis.
  4. Map each emoji to its hour value from 1 to 12.
  5. Read the values in pairs and interpret each pair as a base-12 number.
  6. Convert each number to an ASCII character and concatenate the result. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍
python
#!/usr/bin/env python3

from html import unescape
from pathlib import Path

data = Path("tasks/hackerlab/Часовщик/task.txt").read_text(encoding="utf-8").strip()
clocks = unescape(data).split()

clock_to_value = {
    "🕐": 1,
    "🕑": 2,
    "🕒": 3,
    "🕓": 4,
    "🕔": 5,
    "🕕": 6,
    "🕖": 7,
    "🕗": 8,
    "🕘": 9,
    "🕙": 10,
    "🕚": 11,
    "🕛": 12,
}

values = [clock_to_value[emoji] for emoji in clocks]
plaintext = "".join(chr(a * 12 + b) for a, b in zip(values[::2], values[1::2]))

print(plaintext)

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

The decoded string is the final flag:

text
CODEBY{REDACTED}

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