Mirai is an easy-rated Linux machine from HackTheBox created by Arrexel. It was weird to find nothing at the start. In this machine, it was essential to research elements, mainly because of its IoT orientation. In the current post, my IP is 10.10.14.20, and the target’s IP is 10.129.210.160.
Gathering Information
First, we are going to start with checking if the machine is alive, then do the classic reconnaissance to get some general information about the target.
nmap-sCV-p22,53,80,1501,32400,3246910.129.210.160-oNWebScanStartingNmap7.92 ( https://nmap.org ) at 2023-05-07 20:53 Pacific SA Standard TimeNmapscanreportfor10.129.210.160Hostisup (0.16s latency).PORTSTATESERVICEVERSION22/tcpopensshOpenSSH6.7p1Debian5+deb8u3 (protocol 2.0)|ssh-hostkey:|1024aa:ef:5c:e0:8e:86:97:82:47:ff:4a:e5:40:18:90:c5 (DSA)|2048e8:c1:9d:c5:43:ab:fe:61:23:3b:d7:e4:af:9b:74:18 (RSA)|256b6:a0:78:38:d0:c8:10:94:8b:44:b2:ea:a0:17:42:2b (ECDSA)|_2564d:68:40:f7:20:c4:e5:52:80:7a:44:38:b8:a2:a7:52 (ED25519)53/tcpopendomaindnsmasq2.76|dns-nsid:|_bind.version:dnsmasq-2.7680/tcpopenhttplighttpd1.4.35|_http-title:Sitedoesn't have a title (text/html; charset=UTF-8).|_http-server-header: lighttpd/1.4.351501/tcp open upnp Platinum UPnP 1.0.5.13 (UPnP/1.0 DLNADOC/1.50)32400/tcp open http Plex Media Server httpd| http-auth:| HTTP/1.1 401 Unauthorized\x0D|_ Server returned status 401 but no WWW-Authenticate header.|_http-title: Unauthorized|_http-favicon: Plex|_http-cors: HEAD GET POST PUT DELETE OPTIONS32469/tcp open upnp Platinum UPnP 1.0.5.13 (UPnP/1.0 DLNADOC/1.50)Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Here we have something inusual at the port 53, "dnsmasq 2.76", after some research about it, is just a Free Software Providing Domain Name System (DNS), with a big list of exploits, we will save it for later.
By using curl we get a new relevant information, "Pi-hole", after some research, I found that is an application to block adds and trackers, and is designed to work in embed devices with network availability, like a Raspberry Pi.
The information about being a Raspberry Pi was pretty hidden, so it is worth to try the default credentials at the SSH port {user: pi} {password: raspberry}.
I tried with cat first, bad idea, I find a lot of illegible information, and then with cd /dev/, there are a lot of files. At this point the best option is to execute it, if it fails or we can't do anything, we can analize the file with strings