Capture the flag (CTF)

Hack the Box (HTB) machines walkthrough series — Remote

Security Ninja
October 29, 2020 by
Security Ninja

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 Remote.

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.

What should you learn next?

What should you learn next?

From SOC Analyst to Secure Coder to Security Manager — our team of experts has 12 free training plans to help you hit your goals. Get your free copy now.

The walkthrough

Note: Only write-ups of retired HTB machines are allowed. The machine in this article, named Remote, 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 “Remote” machine IP is 10.10.10.180.
  3. We will adopt our usual methodology of performing penetration testing. Let’s start with enumeration in order to gain 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 Remote 10.10.10.180>>

  5. As we have multiple ports opened, let’s start enumeration with port 80. Below, we can see the home page.
  6. Enumerating more: under the Contact Us page, there is a further link to a login page.
  7. Looking into the login page, we can see that it is using “embraco” as a portal engine.
  8. Looking into exploits, we have some hits, but all of them require auth exploits.
  9. Let’s park the enumeration for now and move to the next set of ports.
  10. We can show that mount is available, so using showmount, we can see that a path is available.
  11. Mount it to the attacking box as shown below and then enumerate the folder.
  12. Under App_Data, we have embraco.sdf. Running strings on it for strings such as “admin” reveals a hash.
  13. We can break the hash via online cracking tools and reveal that the hashed phrase is “baeconandcheese”.
  14. So now that we have the username and password, we can hook the creds in the exploit.
  15. Running the exploit as shown below with the required parameters
  16. And we got the shell back. We now enumerate to grab the user.txt file.

  17. For further escalation, let’s upload PowerUp to the box and run Invoke-AllChecks:
  18. Running the checks, we can see that we can exploit the service UsoSvc, as it has weak permissions.
  19. Uploading nc64.exe to the box, as shown below
  20. Using the PowerUp Invoke-ServiceAbuse function, we can abuse the service to span a shell as soon as it is restarted. As shown below, the service is abused and the reverse shell with system privileges is gained.

What should you learn next?

What should you learn next?

From SOC Analyst to Secure Coder to Security Manager — our team of experts has 12 free training plans to help you hit your goals. Get your free copy now.

And we’re done! This was a very straightforward box, with initial enumeration depending on information gathered from multiple ports. Escalation is straightforward.

We will continue this series with more examples of interesting HTB machines.

Security Ninja
Security Ninja