Hack The Box

Hack The Box: Mirai Walkthrough

Mirai retains the Raspberry Pi default SSH credentials and grants the pi account unrestricted sudo.

Mirai Hack The Box machine artwork
Official Hack The Box machine artwork for Mirai.Hack The Box machine page opens in a new tab

Recon & Enumeration

Use nmap to full scan for open ports and services:

HackTheBox “Mirai” Walkthrough, figure 2

Visit the target at port 80.

HackTheBox “Mirai” Walkthrough, figure 3

It shows us a blank page, so, run Dirsearch to enumerate hidden files and directories:

HackTheBox “Mirai” Walkthrough, figure 4

The directory /admin is one of the findings, Review it.

HackTheBox “Mirai” Walkthrough, figure 5

And we have the Pi-hole admin dashboard, we can click on the Login button on the left sidebar.

HackTheBox “Mirai” Walkthrough, figure 6

The default username for the Pi-hole application is "pi" with the password "raspberry", but it doesn't seem to work here.

Exploitation:

Since we know from the nmap scan that SSH is running, we can connect to the target.

HackTheBox “Mirai” Walkthrough, figure 7

Privilege Escalation:

List the privileges we have here with the username pi.

HackTheBox “Mirai” Walkthrough, figure 8

It seems that we have sudo for all with no password.

HackTheBox “Mirai” Walkthrough, figure 9

And we have a root shell.

Further reading

Evidence connected to this article.

Back to article start