[HTB] Linux Fundamentals

Find out the machine hardware name and submit it as the answer.
htb-student@nixfund:~$ uname -m

What is the path to htb-student's home directory?
htb-student@nixfund:~$ pwd

What is the path to the htb-student's mail?
htb-student@nixfund:~$ env

Which shell is specified for the htb-student user?
htb-student@nixfund:~$ echo $SHELL

Which kernel version is installed on the system? (Format: 1.22.3)
htb-student@nixfund:~$ uname -a

What is the name of the network interface that MTU is set to 1500?
htb-student@nixfund:~$ ifconfig

What is the name of the hidden “history” file in the htb-user's home directory?
htb-student@nixfund:~$ ls -a

What is the index number of the “sudoers” file in the “/etc” directory?
htb-student@nixfund:~$ cd /etc/
htb-student@nixfund:/etc$ ls sudo* -l -i

What is the name of the last modified file in the “/var/backups” directory?
htb-student@nixfund:/etc$ ls -a -ls /var/backups/

What is the inode number of the “shadow.bak” file in the “/var/backups” directory?
htb-student@nixfund:/etc$ ls /var/backups/ -i | grep shadow.bak

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?

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

Submit the full path of the “xxd” binary.
htb-student@nixfund:/$ find /usr/bin/ -type f -name *xxd

How many files exist on the system that have the “.log” file extension?
htb-student@nixfund:/$ find / -type f -name *.log 2>/dev/null | wc -l

How many total packages are installed on the target system?
htb-student@nixfund:/$ dpkg –list | grep ii | wc -l

How many services are listening on the target system on all interfaces? (Not on localhost and IPv4 only)
htb-student@nixfund:/$ netstat -l

Determine what user the ProFTPd server is running under. Submit the username as the answer.
htb-student@nixfund:/$ ps aux

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.
curl https://www.inlanefreight.com | tr “ “ “\n” | sort -u | grep -E ‘src|href’ | sort -u | wc -l

Which option needs to be set to create a home directory for a new user using “useradd” command?
man useradd This command will display the manual page for the useradd command, providing detailed information about its various options, syntax, and usage.

Which option needs to be set to lock a user account using the “usermod” command? (long version of the option)
man usermod This command will display the manual page for the usermod command, providing detailed information about its various options, syntax, and usage.

Which option needs to be set to execute a command as a different user using the “su” command? (long version of the option)
man usermod This command will display the manual page for the usermod command, providing detailed information about its various options, syntax, and usage.

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.
systemctl list-units | grep Load

What is the type of the service of the “syslog.service”?
systemctl show syslog.service -p Type

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).
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.
php -s 127.0.0.1:8080

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