following the https://github.com/learntocloud/linux-ctfs . i explored and learnt so many new things that i'd like to share with you all.
What is CTF Linux Challenge?
CTF Linux Challenge is designed for folks to get hands-on experience with Linux. so one does not only know the theory but knows how to implement them in the long run. In this challenge we as learner have to "Capture The Flag" where we type-in commands in Linux terminal to complete assigned tasks and when we enter the correct command we provoke the flag, verify it and move to next challenge.
little overview of what all is needed before starting:
1.Version Control:
- method used to keep track and control every change we make to a file/folder/software/product that we're building
- commonly used version control system is Git, which is really fast, reliable, scalable Open-Source version control system
- GitHub is a cloud platform that uses Git as its core technology
- learn how to practice and understand from here
2.Cloud CLI Setup:
- first is to create a cloud account:
but why do we need it? so we could request services like servers and perform the work that we wish to do. - more as we move along this blog.
now create account one either one of the platforms i.e AWS, Azure, Google Cloud. we will work with AWS.
understand the console: provides every information about your cloud account at one place, the servers that are currently active, paused and everything we need to know about our account or to request any cloud service
learn why CLIs are better than clicking: manual clicking and hovering is much tiresome , so CLIs help in overcoming that issue
we install respective CLI
3.IAC(Infrastructure as a Code):
- method used to manage infrastructure with configuration file rather than GUI. it helps in manage, change and build infrastructure in safe, consistent, way by defining resource configurations that we can version using VCS like GitHub
- Terraform is most commonly used IAC engine
Key terms:
-
terraform init: initializes working directory with terraform configuration files -
terraform apply: a core component of the Terraform workflow used to execute the actions proposed in a Terraform plan, provisioning or updating your infrastructure to match your configuration files
4.SSH
SSH(secure shell) sets up a connection between a user's device and a faraway machine, often a server.
SSH can transmit any arbitrary data over a network, and SSH tunneling can be set up for a myriad of purposes.
work in a nutshell:
we spin up an AWS ec2 instance(a computer faraway). then use ssh to connect to it(access it). now we can do many things like installing an OS (linux os) on this computer, sending a local file to remote server etc.
Background check:
first is to prepare the setup where it is recommended to use WSL for Windows users. WSL(Windows Subsystem for Linux) is like a machine where you can install Linux instead of dual-booting your system in order to avoid memory issues and prevent your system from over-loading.
Now you can install a Linux distribution of your choice from windows package manager, I installed Ubuntu.
wsl is like using a linux os, with direct terminal opened for you. from where you can check what folders, files we have on our system , download files etc. Soo cool!!😎✨
we open wsl ubuntu terminal, clone the github repo i.e https://github.com/learntocloud/linux-ctfs .
then do: cd linux-ctf/aws
- we have to install terraform on this wsl as well otherwise terraform commands won't work.
then we do terraform init
now after this we need to create access key for iam user(concept in AWS cloud). iam user is used so we do not have to use root user.
i created one iam user named 'rg', i create access keys so now we have both access key and security access key.
now in the ubuntu wsl terminal i write the three commands:
then we perform terraform apply. now an EC2 instance is up and running.
remember to delete the access keys and both instance when done with session to avoid charges.
then i enter the commands:
and it begins!!🥳
- start from here to find tasks: tasks list
Challenge 1:
first task is find hidden file in ctf_challenges

ls -a : used to list all files in a directory(including hidden files)
cat filename : used to read content of a file
Challenge 2: Locate a file containing "secret" in its name under your home directory
learnt to use commands like:
find pathname -type f -name <pattern>
cd directory: change directory
ls directory: list directory content
cat filename: list file content
Challenge 3: Find and read an unusually large file in /var/log
commands helpful:
ls -lh: list file with human-readable sizes
tail -n 100 filename: View the last 100 lines.
tail filename: view the end of the file
This blog turned into a long one. if you're still here, thank you! i hope this proves helpful in some way.
next challenges will be covered in part - 2.
Any feedback is greatly appreciated.




Top comments (0)