← Back to Writeups
CUSTOMEasyCrypto

Родственники (Rodstvenniki)

XESXOR9/10/20262 min read
#crypto#custom#easy#base64_decoding#hash_cracking#hash_length_identification#linux

Родственники (Rodstvenniki)

Platform: hackerlab | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: Linux | Author: XESXOR | Date: 2025-12-25 | Status: Solved Techniques: base64_decoding, hash_cracking, hash_length_identification

Summary

Task: String with mixed hex sequences (32/64/128 chars) and Base64. Solution: Identify hash types by length (MD5/SHA256/SHA512), decode Base64, crack hashes to assemble the flag.

Родственники (Rodstvenniki) — HackerLab

Description

Собрались все представители рода, а не только семья (All representatives of the genus gathered, not just the family)

Flag format: codeby{flag}

Analysis

The task contains a string with different types of encoding/hashing:

04bb67a1914803ff834a4a25355ad9f3 ew== da2f073e06f78938166f247273729dfe465bf7e46105c13ce7cc651047bf0ca4 d2e2adf7177b7a8afddbc12d1634cf23ea1a71020f6a1308070a16400fb68fde 162bc653a2c41b8a621ab600318b8cf05144bc11dd9e68415390445d9f80e317d57aabe56ef7dead6a47c7176f049f8bb43c9bf125769166e993fc26e521312b fQ==

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

The name "Родственники" (Relatives) hints at a "family" of cryptographic hash functions (MD5, SHA256, SHA512 — all related hashing algorithms).

Identification by Length

PartLengthTypeValue
04bb67a1914803ff834a4a25355ad9f332 hexMD5codeby
ew==4 charsBase64{
da2f073e06f78938166f247273729dfe465bf7e46105c13ce7cc651047bf0ca464 hexSHA256crypto
d2e2adf7177b7a8afddbc12d1634cf23ea1a71020f6a1308070a16400fb68fde64 hexSHA256_
162bc653a2c41b8a621ab600318b8cf05144bc11dd9e68415390445d9f80e317d57aabe56ef7dead6a47c7176f049f8bb43c9bf125769166e993fc26e521312b128 hexSHA512genius
fQ==4 charsBase64}
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Solution

Step 1: Splitting the String

python
#!/usr/bin/env python3
import base64
import hashlib

data = "04bb67a1914803ff834a4a25355ad9f3 ew== da2f073e06f78938166f247273729dfe465bf7e46105c13ce7cc651047bf0ca4 d2e2adf7177b7a8afddbc12d1634cf23ea1a71020f6a1308070a16400fb68fde 162bc653a2c41b8a621ab600318b8cf05144bc11dd9e68415390445d9f80e317d57aabe56ef7dead6a47c7176f049f8bb43c9bf125769166e993fc26e521312b fQ=="

parts = data.split()
for i, part in enumerate(parts):
    print(f"{i+1}. '{part}' - length: {len(part)}")

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

Output:

1. '04bb67a1914803ff834a4a25355ad9f3' - length: 32  -> MD5
2. 'ew==' - length: 4  -> Base64
3. 'da2f073e06f78938166f247273729dfe465bf7e46105c13ce7cc651047bf0ca4' - length: 64  -> SHA256
4. 'd2e2adf7177b7a8afddbc12d1634cf23ea1a71020f6a1308070a16400fb68fde' - length: 64  -> SHA256
5. '162bc653a2c41b8a621ab600318b8cf05144bc11dd9e68415390445d9f80e317d57aabe56ef7dead6a47c7176f049f8bb43c9bf125769166e993fc26e521312b' - length: 128  -> SHA512
6. 'fQ==' - length: 4  -> Base64

Step 2: Decoding Base64

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

python
# Base64 parts
print(base64.b64decode("ew==").decode())  # {
print(base64.b64decode("fQ==").decode())  # }

Step 3: Cracking the Hashes

Using CrackStation or hashcat to crack:

bash
# MD5: 04bb67a1914803ff834a4a25355ad9f3 -> codeby
# SHA256: da2f073e06f78938166f247273729dfe465bf7e46105c13ce7cc651047bf0ca4 -> crypto
# SHA256: d2e2adf7177b7a8afddbc12d1634cf23ea1a71020f6a1308070a16400fb68fde -> _
# SHA512: 162bc653a2c41b8a621ab600318b8cf05144bc11dd9e68415390445d9f80e317d57aabe56ef7dead6a47c7176f049f8bb43c9bf125769166e993fc26e521312b -> genius

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

Step 4: Verification

python
#!/usr/bin/env python3
import hashlib
import base64

# Verify found values
tests = [
    ("md5", "04bb67a1914803ff834a4a25355ad9f3", "codeby"),
    ("sha256", "da2f073e06f78938166f247273729dfe465bf7e46105c13ce7cc651047bf0ca4", "crypto"),
    ("sha256", "d2e2adf7177b7a8afddbc12d1634cf23ea1a71020f6a1308070a16400fb68fde", "_"),
    ("sha512", "162bc653a2c41b8a621ab600318b8cf05144bc11dd9e68415390445d9f80e317d57aabe56ef7dead6a47c7176f049f8bb43c9bf125769166e993fc26e521312b", "genius"),
]
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

for algo, expected_hash, plaintext in tests:
    if algo == "md5":
        computed = hashlib.md5(plaintext.encode()).hexdigest()
    elif algo == "sha256":
        computed = hashlib.sha256(plaintext.encode()).hexdigest()
    elif algo == "sha512":
        computed = hashlib.sha512(plaintext.encode()).hexdigest()
    
    match = "OK" if computed == expected_hash else "FAIL"
    print(f"{algo}({plaintext}) = {match}")

# Assemble the flag
flag = "codeby" + "{" + "crypto" + "_" + "genius" + "}"
print(f"\nFlag: {flag}")

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

Useful Resources

  • CrackStation - online hash cracking
  • Hash Identifier - hash type identification
  • hashcat - local hash cracking ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍