Ashfall Terminal Writeup

Challenge Name: Ashfall Terminal
Challenge Link: https://learn.hacklido.com/challenges/ashfall-terminal
Category: Reverse Engineering
Difficulty: Easy – Medium
Flag Format: HackCTF{...}
Challenge Description
…
Step 1 – Download and Identify the Binary
file ashfall
Output:
ashfall: ELF 64-bit LSB executable
Step 2 – Check Binary Protections
checksec ashfall
Step 3 – Execute the Binary
chmod +x ashfall
./ashfall
Output:
=== ASHFALL TERMINAL ===
Enter Access Code:
Step 4 – Extract Strings
strings ashfall
Step 5 – Open in Ghidra
…
Step 6 – Analyze the Validation Logic
encrypted = input[i];
encrypted ^= key[i % 7];
encrypted = ROL(encrypted,3);
encrypted += 2*i;
Step 7 – Reverse the Algorithm
byte = (byte - 2*i) & 0xff
byte = ((byte >> 3) | ((byte << 5) & 0xff)) & 0xff
byte ^= key[i % len(key)]
Step 8 – Python Script
# Python Script
Step 9 – Verify the Flag
./ashfall
Output:
ACCESS GRANTED
Final Flag
HackCTF{r0t4t3_x0r_4dd_1nd3x}
Tools Used
- Ghidra
- Strings
- Checksec
- Python 3
- Linux Terminal
Conclusion
This challenge demonstrates how XOR encryption, bit rotations, and simple arithmetic transformations are commonly used in reverse engineering challenges. By understanding the validation routine and reversing each operation, we successfully recovered the correct access code and obtained the flag.