# Nmap 7.70 scan initiated Sun Jul 7 12:18:27 2019 as: nmap -sV -sC -O -A -p 22,80 -oN O-detailed 10.10.10.75Nmapscanreportfor10.10.10.75Hostisup (0.20s latency).PORTSTATESERVICEVERSION22/tcpopensshOpenSSH7.2p2Ubuntu4ubuntu2.2 (Ubuntu Linux; protocol2.0)|ssh-hostkey:|2048c4:f8:ad:e8:f8:04:77:de:cf:15:0d:63:0a:18:7e:49 (RSA)|25622:8f:b1:97:bf:0f:17:08:fc:7e:2c:8f:e9:77:3a:48 (ECDSA)|_256e6:ac:27:a3:b5:a9:f1:12:3c:34:a5:5d:5b:eb:3d:e9 (ED25519)80/tcpopenhttpApachehttpd2.4.18 ((Ubuntu))|_http-server-header:Apache/2.4.18 (Ubuntu)|_http-title:Sitedoesn't have a title (text/html).Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed portAggressive OS guesses: Linux 3.12 (95%), Linux 3.13 (95%), Linux 3.16 (95%), Linux 3.18 (95%), Linux 3.2 - 4.9 (95%), Linux 3.8 - 3.11 (95%), Linux 4.4 (95%), Linux 4.2 (95%), ASUS RT-N56U WAP (Linux 3.4) (95%), Linux 4.8 (94%)No exact OS matches for host (test conditions non-ideal).Network Distance: 2 hopsService Info: OS: Linux; CPE: cpe:/o:linux:linux_kernelTRACEROUTE (using port 22/tcp)HOP RTT ADDRESS1 250.62 ms 10.10.14.12 247.36 ms 10.10.10.75OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .# Nmap done at Sun Jul 7 12:18:51 2019 -- 1 IP address (1 host up) scanned in 24.98 seconds
Just to be sure I ran gobuster on both the root directory as well as on the nibbleblog directory.
Did a searchsploit and found a Arbitrary file upload vulnerability. However it was a metsaploit module, so for my OSCP spirit, I went ahead and searched the internet to learn to exploit this vulnerability manually. However, the vulnerability required admin credentials, which even after enumerating I was not able to harvest from the website or it's source code, so they were to be guessed.
As per sudo -l I can run the mentioned script as root without any password, however, the interesting part to note in this output is sudo: unable to resolve host Nibbles: Connection timed out. This means when I'll try to run sudo I won't be able to execute anything successfully as the hostname and the hosts files are messed up.
Had to google around to finally reach to a promising solution which did not require to modify /etc/hosts or /etc/hostname files, which apparently I just can not as I am low privileged user on the box.
No more error message this means now I can run the script, however before that we'll have to modify the script to get root flag.
As evident from the directory listing, there was no script or the folder as in the sudo description, however, there was a zip file named personal.zip. I unzipped the file to get the exact same structure as the one specified in the sudo. All I had to do was replace the original monitor.sh with my modified version and run.
Modified monitor.sh in /home/nibbler/personal/stuff/monitor.sh
Learned a little more about how sudo can be manipulated if some settings are not working fine. Learned about how to exploit NibbleBlog 4.0.3, which was relatively easy. I am very bad, like really bad, at credentials guessing.