When you starting your career in cybersecurity, you must know how to use the Linux operating system, a critical skill in cyber security. Many servers and security tools use Linux, and people like me use Linux as their daily driver who are interested in IT security.
Linux is one of the major operating system used in organisations all around the world. Well if you are kinda interested in cybersecurity and wants to learn hacking your should probabily start using Linux.
This article is a walkthought of TRYHACKME practice module, this module will focus on getting you comfortable usnig Linux.
Well to practice and learn no need to install any linux operating system on your existing shitty Windows. TryHackMe has its cloud server machines where you can deploy and access your own remote (web-based) linux machine.
First part is an introduction to the Linux basics by learning how to use fundamentally important commands. This room covers the following topics:
Task 1: Intro
If you have your own linux distro then you can SSH into the machine, connect
to thier network and use the following SSH login credentials:
Username:
shiba1
Password: shiba1
Or if you still want to stick to that shitty windows machine, then use Putty to ssh the TryHackMe machine.
Task 2: Methodology
After careful consideration, I've deemed the best way to go about this is to introduce various concepts in sections, with each section being more complex and requiring knowledge from the previous section. To better enable the transition between section, I've split each section into different users in the VM; when you finish a section you'll have to complete a challenge and then you'll be able to move onto the next section.
Task 3: Basic Command Execution
Now, after you logged into the server, we will take a look at some of the
basic commands, and the first command will be echo. Type echo hello
, and press enter and
you'll see your input echoed back at you.
Task 4: Manual Pages and Flags
Remembering all the commands and its hundreds of sub options is not
possible, these options are known as flags.and have the format <command> <flag>
<input>
. You no need to remember all these flags, these flags can be learned about
using the man
command.
Typing that shows us a nicely formatted document:
How would you output hello without a newline?
Ans: echo -n hello
Task 5: Basic File Operations - ls
ls is a command that lists information about every file or directory in the directory. Just running the ls command outputs the name of every file in the directory.
As with other commands ls has many flags that can manipulate the
output. For example ls -a
shows all files/directories including ones that start with
.
What flag outputs all entries?
Ans: -a
What flag outputs things in a "long list" format?
Ans: -l
Task 6: Basic File Operations - cat
cat short for concatenate, does exactly that, it outputs the contents of
files to the console. For example, given a file called a.txt which contains the data "hello", cat
a.txt
would output hello.
What flag numbers all output lines?
Ans: -n
Task 7: Basic File Operations] - touch
touch is a pretty simple command, it creates files. Given the command touch b.txt
, b.txt
would be created.
Task 8: Basic File Operations - Running A Binary
Occasionally there will be times when you want to run downloaded or user created programs. This is done by providing the full path to the binary, for example say you download a binary that outputs noot, providing the full path to that binary will execute it.
Note: A binary is a executable code like exe file in Windos.
Dot ( . ) represents current directory in Linux. Eg: ./hello
Double Dot ( .. ) represents Directory before the current directory. Eg: ../hello
Tilde ( ~ ) represents User's home directory. Eg: ~/hello
How would you run a binary called hello using the directory shortcut. ?
Ans: ./hello
How would you run a binary called hello in your home directory using the shortcut ~ ?
Ans: ~/hello
How would you run a binary called hello in the previous directory using the shortcut .. ?
Ans: ../hello
Task 9: Binary - Shiba1
This task is to run a binary called shiba1, which will create a file called noot.txt. Once you're done run the binary and you'll be given the password for the user shiba2!
Note: the name of the binary is shiba1, as shown in the title
What's the password for shiba2?
Ans: pinguftw
Task 10: su
Now that we have our next user password, it seems like a good time to cover su. su is a command that allows you to change the user, without logging out and logging back in again. For example if you wanted to switch to shiba2 while you're the user shiba1, you would type su shiba2 . You would then be prompted for a password and if you entered shiba2's password you would then become shiba2.
Note: Typing su on its own is equivalent to typing su root.
How do you specify which shell is used when you login?
Ans: -s
Task 11: Linux Fundamentals 2
Now that you have some beginner knowledge to using Linux, its time you take it a step further and join the Linux Fundamentals 2 room.