Start the machine, hack the system, and find the hidden flags to complete this challenge and earn points!
This walkthrough explains how to hack the lab and capture the flags. For help with Learning Mode questions, use the Request Hint button next to each question.
The challenge presents a binary file with a hidden flag embedded within random data. The flag is stored as a string with a length indicator and marker.
Start by examining the file with basic tools:
strings commandstrings secret_binary.bin
This will show you the printable strings in the file, including the flag and the "END_FLAG" marker.
xxd for hex dumpxxd secret_binary.bin
This will show you the raw hexadecimal representation of the file.
The binary file has the following structure:
import struct
with open('secret_binary.bin', 'rb') as f:
# Skip 100 bytes of random data
f.seek(100)
# Read the flag length (4-byte integer)
flag_length = struct.unpack('I', f.read(4))[0]
# Read the flag
flag = f.read(flag_length).decode('utf-8')
print(f"Flag: {flag}")
# Extract the flag length
hex_length=$(xxd -p -s 100 -l 4 secret_binary.bin | tr -d '\n')
# Convert from little-endian hex to decimal
length=$((16#$(echo $hex_length | rev | sed 's/\([0-9a-f]\)\([0-9a-f]\)\([0-9a-f]\)\([0-9a-f]\)/\4\3\2\1/' | rev)))
# Extract the flag
flag=$(dd if=secret_binary.bin bs=1 skip=104 count=$length 2>/dev/null)
echo "Flag: $flag"
The flag is: 85fab29d-d6c6-4373-8a87-db3b83711b3a
To verify the solution:
strings can quickly reveal hidden text dataIf the above methods don't work, you can also:
binwalk to analyze the file structureobjdump if the file is an executableThis challenge demonstrates several important concepts:
Choose how you want to get started
Choose a username to get started
We've sent a 9-character code to your email