Welcome, CTF participants! This guide will walk you through the seven challenges you'll face in this Linux Command Line Capture The Flag. Each challenge is designed to test a different aspect of your Linux skills. Remember, all flags are in the format CTF{some_text_here}.
This CTF challenge requires you to deploy a lab environment in your preferred cloud provider, everything is automated, please refer to individual guides to setup the environment. And then proceed with the CTF Challenges. Start by cloning this repo.
git clone https://github.com/learntocloud/ltc-linux-challenge
Then follow the appropriate guide to deploy the environment.
Objective: Find a hidden file in the ctf_challenges
directory and read its contents.
Skills tested:
ls
with appropriate flagsHint: In Linux, files that start with a dot (.) are considered hidden. How can you list all files, including hidden ones?
Objective: Locate a file with the word "secret" in its name anywhere in the /home/ctf_user directory.
Skills tested:
Hint: The find command can search for files based on their names. How can you use it to search for a file containing "secret" in its name?
Objective: Find the largest file in the /var/log directory and retrieve the flag from it.
Skills tested:
Hint: The du command can help you find file sizes. How can you combine it with sort to find the largest file?
Objective: Identify the user with UID 1001 and find the flag in their home directory.
Skills tested:
Hint: The /etc/passwd file contains information about user accounts. How can you search for a specific UID in this file?
Objective: Locate the file owned by root with permissions 777 and read its contents.
Skills tested:
Hint: The find command can also search for files based on their permissions. What does 777 mean in terms of file permissions?
Objective: Find the process running on port 8080 and retrieve the flag from its command.
Skills tested:
Hint: The netstat
or ss
command can show you which processes are listening on which ports. How can you use these to find a process on a specific port?
Objective: Decode the base64 encoded flag in the 'encoded_flag.txt' file.
Skills tested:
Hint: Linux has a built-in command for base64 decoding. How can you use it to decode the contents of a file?
Good luck, and happy hunting! Remember, the journey of learning is just as important as capturing the flags. Enjoy exploring the power of the Linux command line!