Hack the Box (HTB) machines walkthrough series — Access
Today, we will be continuing with our exploration of Hack the Box (HTB) machines as seen in previous articles. This walkthrough is of an HTB machine named Access.
HTB is an excellent platform that hosts machines belonging to multiple OSes. It also has some other challenges as well. Individuals have to solve the puzzle (simple enumeration plus pentest) in order to log into the platform and download the VPN pack to connect to the machines hosted on the HTB platform.
Note: Only write-ups of retired HTB machines are allowed. The machine in this article, named Access, is retired.
Let’s start with this machine.
1. Download the VPN pack for the individual user and use the guidelines to log into the HTB VPN.
2. The Access machine IP is 10.10.10.98.
3. We will adopt the same methodology of performing penetration testing as we have used previously. Let’s start with enumeration in order to learn as much information about the machine as possible.
4. As usual, let’s start with the Nmap scan to learn more about the services running on this machine. [CLICK IMAGES TO ENLARGE]
<<nmap -sC -sV -oA Access 10.10.10.98>>
5. As we can see, ports 80, 21 and 23 are opened. Interesting. Looks like we will be doing Telnet on this machine.
6. But let’s start with our standard enumeration. Let’s pick port 21. Anonymous login is allowed.
7. We can see two folders titled “Backups” and “Engineer.”
8. Let’s transfer the contents of these two folders to our attacking machine.
<<mget Access Control.zip>>
9. Let’s continue the enumeration over port 80. We have a simple web page with no more information.
10. Let’s go back the contents we have from FTP and analyzing them. In the Engineer folder, there is a ZIP file which needs a password.
11. In the Backup folder, there is a backup.md file. Let’s print the strings in it. After analyzing it for some time, one string pops out, which is access4u@security.
12. Let’s try this as a password for the zip file. And it worked!
13. There is a PST file. Let’s read this with the readpst utility.
<<readpst Access Control.pst>>
14. We can see there is a password mentioned for the security account.
<<cat Access Control>>
15. But where do we use it? Wait …we have telnet, where we can try to apply this if we can get in.
16. Yes, we can. Awesome!
<<telnet -l security 10.10.10.98>>
17. Let’s enumerate to grab the user.txt file.
18. Enumerating more on the system, there was a lnk file under Public User Desktop.
19. If we look into this file’s contents closely, there seems to be usage of cached creds. runas is running with /savecred.
20. We can also see this with the cmdkey command, where Admin creds are listed to be stored.
21. Let’s use this to grab the root.txt file.
<<runas /user:AccessAdministrator /savecred “cmd /c type C:UsersAdministratorDesktoproot.txt > C:UserssecurityDesktopflag.txt”>>
22. Browse to the location of flag.txt and we can see that the file is generated successfully.
23. Grab root.txt.
So, this machine is purely based on enumeration. We first enumerate to get an initial hold of the system, and it then require complete browsing within the directories to see other files.
We will continue this series shortly with more HTB machines.