HackTheBox(HTB)-Uneasy, Stuck-on Questions | Linux Fundamentals | Ken Aurther

Kendaurther
5 min readMay 31, 2023

--

These blog is intended to provide just the answers to the questions which are hard and most people are stuck onto.

Note: Do note that the order of the questions are irregular and also the blog is created for personal reference as well. Use Ctrl+f to search for questions that you are stuck on.

Welcome to HackTheBox, a virtual playground that challenges your skills in the vast world of cybersecurity. If you find yourself venturing into the realm of Linux fundamentals, you’ve come to the right place. Here, we’ll focus on the most challenging questions that often leave even seasoned hackers scratching their heads.

https://startacus.net/culture/hack-the-box-cybersecurity-training-via-ethical-hacking

In this specially curated collection of questions, I have compiled the most difficult challenges faced by individuals attempting to master Linux. These questions will push the limits of your knowledge, demand strategic thinking, and require precise execution. Many have stumbled upon these hurdles, and now you have the opportunity to conquer them with the aid of the expert answers.

So, prepare yourself for an exhilarating adventure into the depths of Linux fundamentals.

The very 1st struggle that most people face is to ssh into the target machine, So, the problem people face is, they start the instance and look for the IP address from the instance machine and when they try to ssh, the password is output as incorrect almost every time, which is an incorrect way to do it.

So, there is place just above the 1st question which tells to launch the target machine and after you click on it, an IP is spawned after a minute and that’s the IP which must be used in order for ssh. The credentials are provided as “username: htb-student” and “password:HTB_@cademy_stdnt!” and connect using command “ssh htb-student@IP-address”. And remember, download and use vpn file for the process to be used successfully.

Now, The questions that people often stuck into are gradually given below, If anywhere you do not find the question you are looking for because the blog is too long, feel free to use Ctrl+f in the browser and search for what you are seeking.

  1. 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?
find / -type f -name *.conf -user root -size +25k -newermt 2020–03–03 -exec ls -al {} \; 2>/dev/null

2. Submit the full path of the “xxd” binary.

find / -type f -name *xdd -user root -size +0 -exec ls -al {} \; 2>/dev/null

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

find / -type f -name “*.log” 2>/dev/null | wc -l

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

netstat -tunl4 | grep -v “127.0.0” | grep “LISTEN” | wc -l

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

ps aux | grep “proftpd” | grep -v “*”

6. 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 -s https://www/inlanefreight.com | tr “ “ “\n” | cut -d “‘“ -f2 | cut -d ‘“‘ -f2 | grep “https://www/inlanefreight.com" | sort -u | wc -l

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

useradd — help

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

usermod — help | grep “lock”

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

— command

10. 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 — type=service | grep “Load AppArmor profiles managed internally by snapd”

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

systemctl show syslog.service -p Type

12. 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

13. 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

I know some of the people might be offended because of some of the questions are easy but i found some people were stuck in those as well but if I happen to offend please let me know and I will try to add all of those as well with proper explanation. All of the questions are pretty much difficult ones and most of the questions are not included but, if any user and learners are stuck somewhere in between Linux fundamentals please let me know, I will try to help you out as soon as possible.

--

--