Welcome to the Linux Command Line Capture The Flag (CTF) lab! This project sets up a learning environment where you can practice your Linux command line skills by solving various challenges.
Before you begin, ensure you have the following installed on your local machine:
Follow these steps to set up and access your CTF lab environment:
-
Clone this repository to your local machine:
git clone https://github.com/learntocloud/ltc-linux-challenge cd ltc-linux-challenge/aws -
(Optional) Modify the AWS region:
-
Open
main.tfand change the default value of theaws_regionvariable, or -
Create a
terraform.tfvarsfile and specify your preferred region:aws_region = "us-east-1"
-
-
Initialize Terraform:
terraform init -
Apply the Terraform configuration:
terraform applyWhen prompted, type
yesto confirm. -
After the apply completes, note the
ctf_instance_public_ipoutput. You'll use this to connect to your lab environment.
To access your lab environment:
-
Use SSH to connect to the EC2 instance:
ssh ec2-user@<ctf_instance_public_ip>
-
When prompted for a password, enter:
CTFpassword123! -
Once logged in, you'll see a welcome message with instructions for your first challenge.

Your CTF lab consists of 7 challenges, each testing different Linux command line skills. The challenges are:
- Find a hidden file
- Locate a file with "secret" in its name
- Find the largest file in a specific directory
- Identify a user with a specific UID
- Locate a file with specific permissions
- Find a process running on a specific port
- Decode a base64 encoded message
Work through these challenges to improve your command line skills and find all the flags!
When you're done with the lab, don't forget to destroy the AWS resources to avoid unnecessary charges:
terraform destroy
Type yes when prompted to confirm.
This lab is designed for learning purposes and uses a password-based login for simplicity. In real-world scenarios, key-based authentication is recommended for better security.
If you encounter any issues:
- Ensure your AWS CLI is correctly configured with your credentials.
- Check that you're using a compatible Terraform version.
- Verify that you have the necessary AWS permissions to create the required resources.
If problems persist, please open an issue in this repository.
Happy learning, and good luck with your CTF challenges!