← Back to Writeups
CUSTOMEasyReversing

task3

XESXOR9/2/20262 min read
#reversing#custom#easy#constraint_solving#disassembly#static_analysis#string_reversal_check

task3

Platform: CUSTOM | Category: Reversing | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: constraint_solving, disassembly, static_analysis, string_reversal_check

Summary

Walkthrough of the CUSTOM Reversing task3. ELF 32-bit binary that reads from two files (Hello1 and Hello2), performs validation checks, and prints the flag if both checks pass.

Description

Complete the checks, and app will print the flag.

ELF 32-bit binary that reads from two files (Hello1 and Hello2), performs validation checks, and prints the flag if both checks pass.

Analysis

Reconnaissance

bash
$ file task3
task3: ELF 32-bit LSB executable, Intel 80386, dynamically linked, not stripped

$ strings task3
Hello1
Hello2
NOOOOO
NOT AGAIN!
Nope
Flag{%s}

The binary is not stripped, revealing function names: main, check, check2. ‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍

Reverse Engineering

Three key functions identified:

main(): Opens files Hello1 and Hello2, reads 8-character strings from each, calls check() and check2(), prints flag if both pass.

check(): Verifies that content of Hello2 is the exact reverse of Hello1. Prints "NOOOOO" or "NOT AGAIN!" and exits on failure.

check2(): Enforces 8 character constraints on the string from Hello1:

ConstraintResult
char[0] == 0x7achar[0] = 'z'
char[1] == 0x66char[1] = 'f'
char[7] == 0x73char[7] = 's'
char[3] == char[7]char[3] = 's'
char[2] == char[3]char[2] = 's'
char[0] == char[6]char[6] = 'z'
char[5] == 0x69char[5] = 'i'
char[5] - char[4] == 8char[4] = 0x69 - 8 = 0x61 = 'a'
‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍

Solution

Combining all constraints:

  • Position 0: 'z'
  • Position 1: 'f'
  • Position 2: 's'
  • Position 3: 's'
  • Position 4: 'a'
  • Position 5: 'i'
  • Position 6: 'z'
  • Position 7: 's'

Hello1: zfssaizs Hello2 (reverse): sziassfz

bash
# Create input files
echo -n "zfssaizs" > Hello1
echo -n "sziassfz" > Hello2

# Run binary
./task3
# Output: Flag{REDACTED}

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

Key Takeaways / Lessons

  • Mastering constraint_solving, disassembly, static_analysis, string_reversal_check was key to this challenge.
  • Always check for common misconfigurations and verify assumptions.

Crafted by XESXOR Research • 2026-03-09 • CUSTOM • task3 • Difficulty: Easy