NahamCon 2024 CTF!: Twine
Twine
Author: @JohnHammond#6971
Google tells me that twine means:
“strong thread or string consisting of two or more strands of hemp, cotton, or nylon twisted together.”
Solution
Step 1: Using the strings
Command
The strings
command scans through a binary file and prints the sequences of printable characters. It’s often used for quick analysis to find readable text in executable files or other binary data.
Step 2: Using grep
to Filter the Output
The grep
command searches for specific patterns within text. By combining strings
with grep
, you can directly search for specific keywords, such as "flag", within the output of strings
.
Step 3: Executing the Command
The provided solution involves running the following command in a Unix-like terminal:
itswiz@TheWiz:/mnt/d/temp_cli/nc2024$ strings twine.jpg | grep flag
Here’s a breakdown of the command:
strings twine.jpg
: This part scans thetwine.jpg
file and prints any sequences of printable characters found within it.|
: The pipe operator takes the output of the command on its left (in this case,strings twine.jpg
) and passes it as input to the command on its right (grep flag
).grep flag
: This part filters the output, searching for any lines that contain the word "flag".
Step 4: Analyzing the Output
The output of the command reveals the flag:
itswiz@TheWiz:/mnt/d/temp_cli/nc2024$ strings twine.jpg | grep flag
flag{4ac54e3ba5f8f09049f3ad62403abb25}