In this hackthebox lesson, we will learn about the fundamentals of Linux and receive a thorough overview of what Linux is, why it is significant, and its history. It also goes over the various components of Linux and the Linux architecture.
Logging In via SSH
To begin, we must connect to the VPN in Linux before connecting to the target machine. This will establish a safe and encrypted connection between your machine and the VPN server. The tunnel will route all of your internet traffic, ensuring your privacy and security.
To set up OpenVPN on Linux, we must first build an OpenVPN configuration file. This file provides the configuration information that OpenVPN requires to connect to your VPN server, such as the server’s address, port, and authentication credentials.
We can start the OpenVPN connection after you have created the OpenVPN configuration file by performing the following command.
| openvpn <config_file_name>
System Information
- Find out the machine hardware name and submit it as the answer.
2. What is the path to htb-student’s home directory?
3. What is the path to the htb-student’s mail?
| /var/mail/htb-student
4. Which shell is specified for the htb-student user?
5. Which kernel version is installed on the system? (Format: 1.22.3)
6. What is the name of the network interface that MTU is set to 1500?
Navigation
- What is the name of the hidden “history” file in the htb-user’s home directory?
2. What is the index number of the “sudoers” file in the “/etc” directory?
Working with Files and Directories
- What is the name of the last modified file in the “/var/backups” directory?
2. What is the inode number of the “shadow.bak” file in the “/var/backups” directory?
Find Files and Directories
- What is the name of the config file that has been created after 2020–03–03 and is smaller than 28k but larger than 25k?
2. How many files exist on the system that have the “.bak” extension?
3. Submit the full path of the “xxd” binary.
File Descriptors and Redirections
- How many files exist on the system that have the “.log” file extension?
2. How many total packages are installed on the target system?
Filter Contents
- How many services are listening on the target system on all interfaces? (Not on localhost and IPv4 only)
2. Determine what user the ProFTPd server is running under. Submit the username as the answer.
3. Use cURL from your Pwnbox (not the target machine) to obtain the source code of the “https://www.inlanefreight.com" website and filter all unique paths of that domain. Submit the number of these paths as the answer.
User Management
- Which option needs to be set to create a home directory for a new user using “useradd” command?
2. Which option needs to be set to lock a user account using the “usermod” command? (long version of the option)
3. Which option needs to be set to execute a command as a different user using the “su” command? (long version of the option)
Service and Process Management
- Use the “systemctl” command to list all units of services and submit the unit name with the description “Load AppArmor profiles managed internally by snapd” as the answer.
Task Sheduling
- What is the type of the service of the “syslog.service”
File System Management
- How many disks exist in our Pwnbox? (Format: 0)