Introduction
As we progress further in the Bandit Challenge, Level 13 ↗️ presents us with a unique challenge. Our objective is to find a password hidden within the “data.txt” file, which is a hexdump representation of a repeatedly compressed file.
Challenge Overview
Level 13 challenges us to search for a password within the “data.txt” file, which is a hexdump representation of a repeatedly compressed file. Our task is to extract the hexdump, recreate the original file, and obtain the password.
By using commands like xxd
, cp
, mv
, and file
along with creating a temporary
directory, we’ll manipulate the data, decompress the file, and successfully obtain
the password.
Approach and Strategy
Follow these steps to successfully solve Level 13
Enter the password you obtained from the previous level.
Once logged in, Create a temporary directory under /tmp
using the mkdir
command:
This command will create a temporary directory where we’ll perform our operations.
Copy the “data.txt” file to the temporary directory using the cp
command:
Change your working directory to the temporary directory using the cd
command:
Convert the hexdump back to binary data using the xxd
command:
This command reverses the hexdump and creates a binary file named “data”
Determine the file type of “data” using the file
command:
This command provides information about the file type.
Based on the output of the previous command, decompress the file using the appropriate command. Output would be like this
Now, if the file is gzip compressed
use the gzip
command:
if the file is bzip compressed
use the bzip2
command:
And if the file is tar compressed
then use the tar
command:
Keep repeating these steps till you reach a point where the file data
returns a “ASCII text” output
Once you have successfully reached this state, examine its contents using the cat
command. Look for the password within the file.
The password for Level 13 will be displayed in the output. Take note of it for the next level.
Notes
- Create a temporary directory under
/tmp
using themkdir
command to perform your operations and avoid cluttering your home directory. - Use the
cp
command to make a copy of the file andmv
command to rename it for easier manipulation. - Reverse the hexdump to recreate the original file using the
xxd
command with the-r
option. - Determine the file type using the
file
command and apply the appropriate decompression command (e.g., `gzip, bzip2, tar) accordingly. - Repeat the decompression process until you obtain the final uncompressed file. This level would require some patience.
Conclusion
Congratulations on successfully completing Level 13 of the Bandit Challenge! By extracting the hexdump, decompressing the file, and examining its contents, we have obtained the necessary password to progress further.
Stay tuned for the next blog post, where we’ll tackle Level 14 and face new challenges in our quest to become proficient cybersecurity practitioners.