Linux Fundamentals —Part 1 [TryHackMe]

gr33nm0nk2802
5 min readJun 11, 2021

Hello friends today we are going to discuss the Linux Fundamentals Part -1 room from TryHackMe. TryHackMe is an awesome place to learn cybersecurity in a gamified manner. So, without any further adieu lets jump right in.

Difficulty: Easy

Room Link: https://tryhackme.com/room/linuxfundamentalspart1

Task #1 : Introduction

This section gives us a little insight of the Linux Fundamental room series.

Task #2 : A Bit of Background on Linux

In this section we discuss about some history of the Linux operating system and where it is used in our day to day examples

A bit of google search reveals the answer

“While still a student at the University of Helsinki, Torvalds started developing Linux to create a system similar to MINIX, a UNIX operating system. In 1991 he released version 0.02; Version 1.0 of the Linux kernel, the core of the operating system, was released in 1994.”

Task #3 : Interact with your first machine in your browser

In this section we are given the instruction to deploy our VM inside of our web browser. Now, there are two ways to access room on TryHackMe. You can either use their attack machine from the browser itself which has all the prerequisite tools installed or you may use the VPN connection file to connect to the lab network.

Click on the start machine to start the machine. Once the machine is deployed simply hit completed.

Task #4 : Running your first few commands

In this section we will take a look at running some of the beginner commands on Linux.

The first command is the echo command. It is similar to the print statement in other programming language or echo in PHP. You simply write echo followed by the string you want to print on the screen.

Note: In the given challenge it is possible to print the string with and without quotes however. The answer format seems to be without quotes.

The second command that we are going to look at is the whoami command. This command helps us to get the username of the current user we are logged in as.

Task #5 : Interacting with the filesystem!

In this section we are going to learn about navigating through the Linux filesystem, reading the contents of a file or directory.

In this section we will take a look at four commands.

The ls command is used to print the contents of the current directory(folder) which we are currently inside of. There are some additional flags that go with the ls command like for the long listing or listing all the contents including the hidden files. To know more about a command its always advisable to read its manpage.

man [command]

The next command is the cd command which basically tells us to change directory to a specific location which is followed by after the cd command. If no path is specified, we are moved to the home directory or (~) tilde. If we use the minus sign, it takes us to the previous directory.

cd [path]

The third command is the cat command whose general task is to print the contents of the file on the screen. Now, we can give multiple files to the cat command and its prints the contents of all the files one after the another hence, this can be used for concatenating files.

cat [filename]

The final command is the pwd command whose basic task is to tell us the full path to the current working directory we are located in.

pwd

Q1. On the Linux machine that you deploy, how many folders are there?

Q2. Which directory contains a file?

We can use the find command to view all the contents inside of the folder. Make note of the path where we used a dot(.) to specify the current working directory.

You can also obviously cd into individual directories and then list the contents but this is a relatively easier process.

Q3. What is the contents of this file?

Q4. Use the cd command to navigate to this file and find out the new current working directory. What is the path?

For this we can use the pwd command while inside of the directory.

Task #6 : Searching for Files

While searching for files two of the most helpful commands are find and grep

Find is a very powerful command and to know its full capability definitely refer to its manpage where we learn more about searching files based on names, extensions, file type, last accessed or modified data, size etc.

The next command grep helps us to grab the contents of the file or grab for files having a given pattern of string.

Q1. Use grep on "access.log" to find the flag that has a prefix of "THM". What is the flag?

Task #7 : An Introduction to Shell Operators

In this section, we discuss about some common operators used in the command line or while writing bash scripts. A quick summary graph is attached to the room.

Task #8 : Conclusions & Summaries

After this room you should go ahead and try Linux Fundamentals Part 2 once you are comfortable with the above commands.

Peace Out

--

--

gr33nm0nk2802

A cybersecurity enthusiast interested in Reverse Engineering. Love to Code