Opaque
EasyMalware Reverse Engineering
Overview
Explore a binary that hides its secrets behind obfuscated pointers and layered encryption. Your goal is to locate the concealed flag by reversing how pointer obfuscation and key-based transformations are applied.
flag format:
flag{***_***********_******}
Lab Details
Prerequisites & Requirements
- PE (Portable Executable) Structure:
- Understanding the layout of a Windows executable, specifically the .data section where global variables and encrypted artifacts are stored.
- Knowing how memory addresses in a running process relate to the file offsets (Virtual Address vs. File Offset).
- C/C++ Reverse Engineering:
- Familiarity with C-style string manipulation functions (strlen, strncpy, fgets).
- Ability to recognize pointer arithmetic and dereferencing in decompiled code (
e.g., *(_QWORD *)v22).
- Cryptography Basics:
- Understanding XOR Encryption/Decryption operations (key ^ value = result).
- Recognizing common obfuscation patterns, such as "Rolling/Rotating Key" algorithms where the key changes or cycles based on the index or a seed.
What will you learn?
- Deobfuscating Pointers:
- Analyzing routines that "fix" or calculate valid memory addresses at runtime (deobfuscate_pointer).
- Understanding how malware authors hide the location of shellcode or flags by only generating valid pointers when specific conditions are met.
- Hybrid Analysis (Static + Dynamic):
- Combining Static Analysis (reading the code in IDA to find the .data section) with Dynamic Analysis (debugging to pluck the ephemeral decryption key from the stack).
- Manual Decryption:
- Extracting raw binary data (the encrypted flag bytes) from a specific memory address.
- Using external tools (CyberChef) to replicate the decryption logic (rotating_key_decrypt) offline using the recovered key (0x87878787) and data.
Tools
- IDA Pro:
- Used for Static Analysis . It allows you to disassemble the binary, view the pseudocode for the user_flag_process function, and locate the encrypted byte array in the .data section (starting at 00007FF62B654050).
- Debugger (Integrated in IDA or x64dbg):
- Used for Dynamic Analysis .
- Setting breakpoints (
e.g., at the xor_decrypt or rotating_key_decrypt calls) allows you to inspect the stack and registers at runtime to reveal the final calculated key (0x87878787) which is otherwise hard to compute statically.
- CyberChef:
- Used for the final Exploitation .
- It serves as the "decryption station" where you input the raw hex bytes extracted from the binary and apply the XOR operation with the discovered key to reveal the plaintext flag.
- Detect It Easy (DiE):
Job Positions
Malware Analyst
Tags
Ida ProStatic AnalysisDynamic AnalysisMalware AnalysisDecompilerPe HeaderObfuscationCryptorMemory DumpStringsCode Flow