Attacking Your First Box - Nibbles
Enumeration

Run an nmap script scan on the target. What is the Apache version running on the server? (answer format: X.X.XX)
Web Footprinting
This shows us how crucial thorough enumeration is. Let us recap what we have found so far:
We started with a simple
nmapscan showing two open portsDiscovered an instance of
NibbleblogAnalyzed the technologies in use using
whatwebFound the admin login portal page at
admin.phpDiscovered that directory listing is enabled and browsed several directories
Confirmed that
adminwas the valid usernameFound out the hard way that IP blacklisting is enabled to prevent brute-force login attempts
Uncovered clues that led us to a valid admin password of nibbles
Initial Foothold
Try with defaults credentails, admin : nibbles and enter -->



Now we have to find out where the file uploaded if it was successful. Going back to the directory brute-forcing results, we remember the /content directory. Under this, there is a plugins directory and another subdirectory for my_image. The full path is at http://<host>/nibbleblog/content/private/plugins/my_image/. In this directory, we see two files, db.xml and image.php, with a recent last modified date, meaning that our upload was successful! Let us check and see if we have command execution.


Gain a foothold on the target and submit the user.txt flag
Privilege Escalation
Now that we have a reverse shell connection, it is time to escalate privileges. We can unzip the personal.zip file and see a file called monitor.sh.
If we do a sudo -l we can see it too -->


In this capture, we can see that im the propietary about monitor.sh. So, delete it and create a new with only "bash" word. With, we can execute it with sudo

Last updated