Skip to main content
  1. Posts/

Write-Up the Needle HTB

·2 mins· 0 · 0 ·
WriteUp HTB Challenge Hardware binwalk
Table of Contents

In this writeup I will show you how I solved The Needle challenge from HackTheBox. The challenge is a very easy hardware challenge. Let’s start!

Initial Analysis>

Initial Analysis #

After downloading and unzipping the file we can see that there is only one file, firmware.bin. We can use the file command to see what kind of file it is.

file firmware.bin
firmware.bin: Linux kernel ARM boot executable zImage (big-endian)

Binwalk #

To analize the file we can use the binwalk command. If we use the -e the program will extract the files from the firmware.

binwalk -e firmware.bin

As we can see now we have a new folder called _firmware.bin.extracted. Let’s go inside and see what’s inside.

The folder is full of files and folders and it’s a bit confusing. We can use the grep command to search for the username and password. The command we will use is:

grep -rn "./" -e login

The -r flag is for recursive search and the -n flag is for printing the line number. The ./ is for searching in the current directory. The -e flag is for searching for a specific string. The string we are searching for is login. The output of the command is:

If we read carefully we can see that maybe we have found the username Device_Admin. Now we need to find the password, we can use the command:

find ./ -name sign

In this case we are using the find command. The -name flag is for searching for a specific file name. The file name we are searching for is sign. The output of the command is:

Bingo! We have found the password this the password:

Now we can try to login using these credentials. To do that we can use the ip address of the machine that is provided by HTB (<IP_address>:).

nc <IP_address> <port>

Conclusion #

Now we need to use the credentials to login to the machine, and explore what’s inside. We will easly find the flag in a file called flag.txt.