Find Files and Directories — Linux Fundamentals Module — HTB Walkthrough

The Malware Mender
2 min readJul 10, 2024

--

TIER 0 MODULE: LINUX FUNDAMENTALS

SECTION: Find Files and Directories

Please open your pwnbox or connect to the vpn, and connect with ssh in order to complete the tasks.

ssh htb-student@<target-ip>
# Enter password 'HTB_@cademy_stdnt!' when asked!

If you are not registered in HTB Academy, then use this link to register now: https://referral.hackthebox.com/mzxKOJt

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?

We will use the information above (in the section) to find this file.

Image from Hack The Box Academy

So the command would be:

find / -type f -name *.conf -size +25k -newermt 2020-03-03 2>/dev/null
  • find / ➡ Means find the given query in the / directory.
  • -type f ➡ Find the searched query which is a file.
  • -name *.conf ➡ All files having a name ending at .conf.
  • -newermt 2020-03-03 ➡ File must be newer than the given date.
  • 2>/dev/null ➡ Forward all errors (i.e. Permission Denied) to the null directory (ignore errors).

Answer: 00-mesa-defaults.conf

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

Same method as the previos question’s but a bit differernt.

find / -type f -name *.bak 2>/dev/null | wc -l

Explaination same as before, but this time we are giving the output of the command as the input of wc command (piping).

💡 The wc is a word-counting program in Linux, and wc -l means count lines of the given input.

Answer: 4

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

To check the paths of any binary program, we use the which command.

which xxd

Answer: /usr/bin/xxd

Still stuck? Watch video!

☣️ HAPPY ETHICAL HACKING ☣️

DISCLAIMER: THIS CONTENT DOES NOT BELONG TO ME, I AM JUST WRITING A WALK-THROUGH OF A FREE MODULE OF HACK THE BOX ACADEMY. (WRITING WALKTHROUGHS OF FREE MODULES IS PERMITTED BY HTB ACADEMY)

The Malware Mender Walkthroughs

--

--

The Malware Mender
The Malware Mender

No responses yet