Strangeness (Странность)
Strangeness (Странность)
Platform: duckerz | Category: Reversing | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-01-09 | Status: Solved Techniques: static_analysis, xor_decryption
Summary
Task: Binary checks input for palindrome and outputs encrypted flag. Solution: Enter any palindrome to pass check, then XOR encrypted bytes with 0x41 to decrypt flag.
Strangeness (Странность) — duckerz
Description
The program asks for a string input and checks it for "strangeness". If the condition is met, it outputs the flag.
Analysis
When analyzing the strangeness binary (ELF 64-bit, not stripped), the following interesting points were discovered:
-
mainfunction:- Takes user input.
- Calls a check function (likely a palindrome check).
- If the check passes, the
decryptfunction is called.
-
Check logic:
- The program compares the string with its reversed copy. Thus, to get the flag, you need to enter any palindrome (e.g.,
abaorracecar).
- The program compares the string with its reversed copy. Thus, to get the flag, you need to enter any palindrome (e.g.,
-
decryptfunction:- The
.rodatasection contains a byte arrayencrypted_flag. - The function iterates through this array and performs an XOR operation on each byte with the constant
0x41.
- The
Solution
Extract the encrypted bytes from the binary and write a simple decryption script.
python read-only • copy allowed#!/usr/bin/env python3 encrypted_flag = [ 0x05, 0x14, 0x02, 0x0a, 0x04, 0x13, 0x1b, 0x3a, 0x12, 0x71, 0x0c, 0x72, 0x1e, 0x12, 0x70, 0x33, 0x20, 0x2f, 0x26, 0x72, 0x1e, 0x07, 0x34, 0x2f, 0x22, 0x70, 0x28, 0x71, 0x2f, 0x3c ] key = 0x41 flag = "".join(chr(b ^ key) for b in encrypted_flag) print(f"Flag: {flag}")
Running the script outputs the flag.