I'm currently working through the Learn to Cloud challenge, focusing on mastering Linux and Bash fundamentals. This repository tracks my progress and contains my solutions and notes.
- Read the book Linux Basics for Hackers up to Chapter 9.
- Completed several challenges from the book.
- Revised the concepts due to previous experience.
- Learned the basics of Infrastructure as Code with a focus on Terraform.
- Completed a crash course on Terraform from YouTube.
The CTF lab included 7 challenges that tested my understanding of different Linux commands. Below are the challenges and their solutions:
Challenge 1: Find the hidden file in this directory and read its contents.
To find hidden files, I used the following command:
ls -a
Files starting with a .
are considered hidden. This helped me locate the file.
Challenge 2: Locate the file with the word "secret" in its name anywhere in the /home/ec2-user directory.
To search for a file containing "secret" in its name, I used grep
:
grep -r "secret" /home/ec2-user
-r
flag makesgrep
search recursively through the directory and its subdirectories.
To find the largest file, I used du
and sort
:
cd /var/log
du -ah | sort -rh | head -n 1
du -ah
: Shows file sizes in human-readable format and includes all files.sort -rh
: Sorts the output in reverse order by size.
The largest file found was:
103M ./journal/ef2474362b044445a8b8f140ffa04be6/system@ac627375d83c410193030948afab916e-000000000003e789-000626bae3dc34f6.journal
To retrieve the flag:
grep -r "flag" ./journal
UIDs are stored in the /etc/passwd
file. To locate a user with UID 1001:
grep ":1001:" /etc/passwd
Then, to access the user’s home directory:
sudo chmod o=rx /home/ctf_user
cd /home/ctf_user
cat flag.txt
I used find
to locate files with specific permissions:
sudo find / -type f -perm 777 -exec ls -l {} +
-type f
: Search for files only.-perm 777
: Search for files with permissions777
.-exec ls -l {}
: Lists detailed information about the found files.
I couldn’t solve this challenge.
To decode the file:
cat encoded_flag.txt | base64 -d
-d
flag is used for decoding.
I'm following the curriculum outlined at learntocloud.guide.
- Gain proficiency in Linux command-line operations.
- Understand and effectively use Git for version control.
- Build a solid foundation for cloud computing concepts.
I'm excited to continue this journey and look forward to progressing through all phases of the Learn to Cloud challenge!
This README will be updated as I progress through the challenge.