HacktheBox - Retired - Blocky - Update
Recon
I'm using threader3000 to do my recon scan. IT first does an up/down scan on all TCP ports then suggests a nmap scan based on the results of the first scan. It automatically saves the output from nmap to an XML for you.
I then convert the XML to HTML to make it easier to read.
So it looks like a linux box
4 ports are open
Port 21 FTP Proftpd 1.3.5
Port 22 SSH OpenSSH 7.2p2
Port 80 HTTP Apache 2.4.18
Port 25565 minecraft 1.11.2
Interesting seeing minecraft on there… let's start with our normal enumeration.
Port 21 let's see if it allows anonymous connections.
Nope.
We'll skip over ssh for right now, that usually is not the path on a HacktheBox machine.
What is it serving on port 80?
Scrolling down we see a link that says login.
Don't mind if we do. Let's check it out.
A wordpress login portal...
Poking around in the source code we see a couple bits of info that might come in handy
Wordpress 4.8 and the name of the theme being used "twentyseventeen"
Googling around for wordpress 4.8 exploits I came across this blog
Which talks about exploiting the xmlrpc.php API.
First let's make sure the API is exposed.
It looks like it is, in the blog they use burp suite to capture this request, change it to POST and get a list of the modules this site uses. So we will try that now.
Here is what our captured request looks like loaded up in repeater.
If we fire that over to blocky
We get this as a response, which is exactly what we saw in firefox.
So if we change it to POST and not GET
It likes the request, we get 200 but it doesn't know what we want it to do since we didn't request it to do anything. In the blog we found they say inserting this will get back the list of modules.
So now our request looks like this.
And we get this back from the server
Here is a cleaned up version of the methods allowed
That is a lot of things we could potentially use this api to do.
Googling around a bit more I stumbled upon a tool name wpscan which comes with kali.
Running its defaults does show some interesting results.
it shows xmlrpc exploits we found earlier, but I also found that you could try to enumerate users using
--enumerate u
Looks like user name is notch
Which we would have found earlier if we were paying closer attention.
You can also use wpscan to bruteforce the password of users.
I just left this running in the background.
Exploit
While running drib against blocky it came back with an interesting folder.
Which included this BlockyCore.jar file. I downloaded a copy of it to my kali box
Nothing I could find built into Kali would open this file, so I googled around and found a tool named jd-gui
I used apt-get to install
Then opened the it with jd-gui and was kind of dumb struck to see this.
Is that really the root password??
One way to find out is using SSH which this box has.. I tried logging in as root with the password.
Nope… but what about that other username we found notch?
We have our foothold.
And we can get our user flag now
Let's work on escalating to root now.
Well when I first get a user account with the credentials on a linux box the first thing I always check is their sudo rights.
OMG, notch can run anything as root.
Should be pretty easy to get our root flag then
But wouldn't we really rather have a root shell?
Netcat should make this trivial.
First let's setup our listener
Then we just use netcat to connect back
No -e option.. So much for being super easy..
Next I tried mkfifo to get my shell
But when it connected back it was still as notch.
Dang….
Wait, are we overthinking this can't we just SU as root?
Comments
Post a Comment