HTB: Dancing
Dancing is a Very Easy Windows machine that introduces the Server Message Block (SMB) protocol and demonstrates the risks of misconfigured SMB shares allowing access without authentication. The machine has multiple open ports, including SMB (445/TCP) with a publicly accessible share containing the flag.
Path to root, at a glance:
- Scan the target → discover open ports including
445(SMB) - Enumerate SMB shares using
smbclient - Find accessible share
WorkShareswith blank password - Navigate to James.P directory and download
flag.txt
Nmap
┌──(r3vpwnx㉿r3vpwnx)-[~/CTF/HTB/Dancing] |
The scan reveals:
- Port 445/tcp: SMB (Server Message Block) - Microsoft-ds
- Port 139/tcp: NetBIOS Session Service
- Port 135/tcp: Microsoft RPC
- Port 5985/tcp: HTTP (WinRM)
- OS: Microsoft Windows Server 2019
The Service: SMB (Server Message Block)
SMB (Server Message Block) is a network file sharing protocol used primarily in Windows environments. Key characteristics:
- Ports: 445 (direct SMB), 139 (NetBIOS over TCP)
- Function: File and printer sharing, inter-process communication
- Authentication: Username/password or guest/anonymous access
- Common vulnerabilities: Null sessions, misconfigured shares, default credentials
Exploitation: Anonymous SMB Access
Enumerating Shares
First, list available SMB shares using smbclient with the -L flag:
┌──(r3vpwnx㉿r3vpwnx)-[~/CTF/HTB/Dancing] |
Available shares:
ADMIN$- Administrative share (requires admin privileges)C$- Default administrative share (requires admin privileges)IPC$- Inter-process communication (requires authentication)WorkShares- Custom share (likely accessible)
Accessing the WorkShares Share
Since we don’t know credentials, we try to connect with a blank password (-N flag):
┌──(r3vpwnx㉿r3vpwnx)-[~/CTF/HTB/Dancing] |
Navigating to the Flag
Change into James.P directory and list contents:
smb: \> cd James.P |
Downloading and Reading the Flag
Use the get command to download the flag. To display it directly without saving, redirect to /dev/stdout:
smb: \James.P\> get flag.txt /dev/stdout |
The flag is displayed immediately before the transfer completion message.
Task Answers
1 What does the 3-letter acronym SMB stand for? Server Message Block
2 What port does SMB use to operate at? 445
3 What is the service name for port 445 that came up in our Nmap scan? microsoft-ds
4 What is the ‘flag’ or ‘switch’ that we can use with the smbclient utility to ‘list’ the available SMB shares on Dancing? -L
5 How many shares are there on Dancing? 4
6 What is the name of the share we are able to access in the end with a blank password? WorkShares
7 What is the command we can use within the SMB shell to download the files we find? get
8 Submit the flag: 5f61c********************64
Key Vulnerabilities
Anonymous/Guest Access
The most critical vulnerability is allowing access to theWorkSharesshare without requiring authentication. This exposes sensitive data to anyone who can reach the SMB service.Sensitive Data Exposure
The flag file was placed in a share that doesn’t require authentication, making it accessible to any anonymous user.Default Administrative Shares
WhileADMIN$andC$require admin access, their presence provides additional attack surface for potential privilege escalation.
Security Recommendations
- Disable guest/anonymous access - Require authentication for all SMB shares
- Implement proper share permissions - Apply principle of least privilege
- Use SMB signing/encryption - Protect against man-in-the-middle attacks
- Restrict access by IP - Limit SMB access to trusted networks only
- Disable default administrative shares - Or restrict them to specific admin users
- Regular security audits - Check for misconfigured shares and permissions
- Use Windows Firewall - Restrict SMB access to authorized subnets
Why It Worked
This machine demonstrates how a single misconfiguration—allowing guest access to an SMB share can lead to data exposure. Even though Windows has robust security mechanisms, improper configurations can nullify these protections. The simplicity of the exploitation highlights the importance of proper SMB security configuration in enterprise environments.





