Hi Hackers Welcome Back, Today we are going to look at Hack The Box Nibbles Machine.
Info Table
Title
Nibbles
Category
Hack The Box
OS
Linux
Difficulty
Easy
Maker
Kill Chain Summery
While enumerating ports and services we can able to find the port 22,80 ware open. web service running on port 80, while digging into deep username and version of the theme found. guessed password, using file upload vulnerability we got initial foothold, escalated priviledge using sudo vulnerability. it is vulnerable to A06:2021-Vulnerable And Outdated Components which can be easily exploited via publicly available scripts and Metasploit.
ββ[atom@atom-vmwarevirtualplatform]β[~/htb/machines]βββ_ $sudo nmap -T4 -p- 10.10.10.75 -oN fs.nmap
Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-17 16:56 IST
Stats: 0:00:22 elapsed;0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 6.30% done; ETC: 17:02 (0:05:27 remaining)Stats: 0:02:34 elapsed;0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 13.50% done; ETC: 17:15 (0:16:27 remaining)Stats: 0:04:35 elapsed;0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 25.93% done; ETC: 17:13 (0:13:05 remaining)Stats: 0:11:56 elapsed;0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 63.51% done; ETC: 17:15 (0:06:51 remaining)Stats: 0:15:20 elapsed;0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 79.79% done; ETC: 17:15 (0:03:53 remaining)Nmap scan report for 10.10.10.75
Host is up (0.29s latency).
Not shown: 65533 closed tcp ports (reset)PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 1209.69 seconds
From here we came to know that only port 22, 80 ware opened. port 22 is for SSH. we can able to do SSH if we know the user name and password or private key. port 80 is a web server, SSH creds may present hidden some ware inside Web server directory, lets we run Gobuster for directory busting.
if we inspect source code on home page we will get a clue to drive exploit http://10.10.10.75/
On the following directory http://10.10.10.75/nibbleblog/README we can able to see the version of nibbling theme.
while digging into google we can see that there is one public exploit available.
It is vulnerable to **CVE-2015-6967 for this exploit we need a username and password. the good thing is we already know the username admin yet to find the password.**
The exploit is code execution vulnerability via image file upload
Information gathered
Itβs a code execution vulnerability.
The vulnerability is in the βMy imageβ plugin that allows the upload of PHP files. So it would allow us to upload a PHP reverse shell.
it is an authenticated vulnerability we need username and password to exploit. we know the username
Alright, so the next steps would be:
Navigate to the admin login page and figure out the admin credentials
Navigate to the My Image plugin page and upload a PHP reverse shell
As mentioned in the Proof of Concept, the admin page can be found here.
Now we need admin credentials. When Iβm presented with an enter credentials page, the first thing I try is common credentials (admin/admin, admin/nibbles, nibbles/nibbles, nibbles/admin). If that doesnβt work out, I look for default credentials online that are specific to the technology. Last, I use a password cracker if all else fails.
In this case, the common credentials admin/nibbles worked!. Next, we need to navigate to the My Image plugin. Click on Plugins > My image > Configure.
navigate to /usr/share/webshell/php/PHP-revershshell.php modify the code according to our needs.