HTB — Linux Fundamentals:System Information
This is a walkthrough of a Linux fundamentals Section in HTB Academy. It is recommended that you do the module in HTB Academy to…
This is a walkthrough of a Linux fundamentals Section(System Information) in HTB Academy. It is recommended that you do the module in HTB Academy to understand what is happening! (BTW IT’S FREE!)
In this section, we will be using openvpn to connect to the HTB Academy network and then attempting the section. If you are unsure of how to connect to openvpn in HTB Academy, you can check this out:
Now, let’s get on with the section Questions:
First of all, we have to activate the target. Then we have to ssh into it…
How do we do that?
The format for ssh is:
ssh targetusername@targetwebsite/targetmachineip -p port-number
So, in this case, we have to:
ssh htb-student@10.129.2.219
Note: The IP will be different for you.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Now that we have done the ssh, let’s see the first question:
[+0] Find out the machine hardware name and submit it as the answer.
The hint states that we should look into the uname utility.
On typing uname --help:
We can clearly see that -i is used to check hardware name:
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
[+1] What is the path to htb-student’s home directory?
If we were to go to the theory part of the section, we would find this:
Since we just did ssh, we are in the home directory. So all we have to do is:
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
[+0] What is the path to the htb-student’s mail?
I was also quite confused about this question. On checking the list of commands given by HTB Academy, I did find something useful:
From the list, at first, nothing seems to be useful. But if you were to check the question, it asks for the path to the htb-student’s email. Out of all these, env is the suitable one. I know this due to my prior experience with env.
Environment variables are determined values to provide the ability that can affect the way programs, applications, and services will behave.
env contains various important paths such as the path to the shell that you are using, the path to the home directory, etc.
So, the answer can be obtained by doing this:
I used | grep mail. | passes the output of env to the right side which is grep. grep is used to find a particular keyword(similar to Ctrl+F) and then displays the narrowed output which contains the keyword which, in this case, is “mail”.
Thus, the answer to the Question will be the path of MAIL.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
[+0] Which shell is specified for the htb-student user?
No information was given in the HTB section on how to do this… so I googled it!
And I found that this can be done by writing:
echo $SHELL
The ‘$’ symbol precedes the PS1 variable name.(www.redhat.com/) And PS1 is an environment variable!(www.digitalocean.com)
Thus, I think that env might contain information on the shell. Let’s see if that is the case:
So we now know the shell ‘htb-student’ is using!
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
[+0] Which kernel version is installed on the system? (Format: 1.22.3)
If you were to type uname --help, you would get this:
On using -v, we obtain:
Thus, -v doesn’t give the required version number. We can either use -a or -r to obtain the answer to the question(what is the kernel version installed?)
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
[+1] What is the name of the network interface that MTU is set to 1500?
I was confused about this question at first, so I decided to obtain some information:
MTU stands for maximum transmission unit. It’s a measurement (typically in bytes) of the largest data packet a device can accept via an internet connection.(www.okta.com)
In HTB Academy, I found a command which is perhaps useful:
By using this, we obtain our solution which is the first network interface:
I hope that my walkthrough helped you in your HTB Academy journey on Linux Fundamentals!