HackTheBox Academy — Linux Fundamentals

Aayan Tiwari
4 min readSep 25, 2023

--

System Information

Questions

Find out the machine hardware name and submit it as the answer.

Answer: x86_64

What is the path to htb-student’s home directory?

Answer: /home/htb-student

What is the path to the htb-student’s mail?

Answer: /var/mail/htb-student

Which shell is specified for the htb-student user?

Answer: /bin/bash

Which kernel version is installed on the system? (Format: 1.22.3)

Answer: 4.15.0

What is the name of the network interface that MTU is set to 1500?

Answer: ens192

Navigation

Questions

What is the name of the hidden “history” file in the htb-user’s home directory?

Answer: .bash_history

What is the index number of the “sudoers” file in the “/etc” directory?

Answer: 147627

Working with Files and Directories

Questions

What is the name of the last modified file in the “/var/backups” directory?

Answer: apt.extended_states.0

What is the inode number of the “shadow.bak” file in the “/var/backups” directory?

Answer: 265293

Find Files and Directories

Questions

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?

Answer: 00-mesa-defaults.conf

How many files exist on the system that have the “.bak” extension?

Answer: 4

Submit the full path of the “xxd” binary.

Answer: /usr/bin/xxd

File Descriptors and Redirections

Questions

How many files exist on the system that have the “.log” file extension?

Answer: 32

How many total packages are installed on the target system?

Answer: 737

Filter Contents

Questions

How many services are listening on the target system on all interfaces? (Not on localhost and IPv4 only)

Answer: 7

Determine what user the ProFTPd server is running under. Submit the username as the answer.

Answer: proftpd

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.

Answer: 34

User Management

Questions

Which option needs to be set to create a home directory for a new user using “useradd” command?

Answer: -m

Which option needs to be set to lock a user account using the “usermod” command? (long version of the option)

Answer: --lock

Which option needs to be set to execute a command as a different user using the “su” command? (long version of the option)

Answer: --command

Service and Process Management

Questions

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.

Answer: snapd.apparmor.service

Task Scheduling

Questions

What is the type of the service of the “syslog.service”?

Answer: notify

Working with Web Services

Questions

Find a way to start a simple HTTP server inside Pwnbox or your local VM using “npm”. Submit the command that starts the web server on port 8080 (use the short argument to specify the port number).

Answer: http-server -p 8080

Find a way to start a simple HTTP server inside Pwnbox or your local VM using “php”. Submit the command that starts the web server on the localhost (127.0.0.1) on port 8080.

Answer: php -S 127.0.0.1:8080

File System Management

Questions

How many disks exist in our Pwnbox? (Format: 0)

Answer: 3

--

--