Hi Hackers Welcome Back, Today we are going to look at Hack The Box Dancing Machine.
Info Table
Room Name | Dancing |
---|---|
Category | Hack The Box |
OS | Linux |
Difficulty | Very Easy |
Maker | Hack The Box |
Kill Chain Summery
While enumerating ports and services we can able to find the port 445 ware open. while trying to connect with empty password. we got some shared access.
Recon
letβs start with initial default scan (-sC) , During scanning, we will typically see port 445 TCP open on the target, reserved for the SMB protocol. Usually, SMB runs at the Application or Presentation layers of the OSI model,
it relies on lower-level protocols for transport. The Transport layer protocol that Microsoft SMB Protocol is most often used with is NetBIOS over TCP/IP (NBT). This is why, during scans, we will most likely see both protocols with open ports running on the target.
|
|
SMB (Server Message Block). This communication protocol provides shared access to files, printers, and serial ports between endpoints on a network. We mostly see SMB services running on Windows machines.
Using the SMB protocol, an client application can read, create, and update files on the remote server. It can also communicate with any server program that is set up to receive an SMB client request.
An SMB-enabled storage on the network is called a share . These can be accessed by any client that has the address of the server and the proper credentials. Like many other file access protocols, SMB requires some security layers to function appropriately within a network topology. If SMB allows clients to create, edit, retrieve, and remove files on a share, there is a clear need for an authentication mechanism. At a user level, SMB clients are required to provide a username/password combination to see or interact with the contents of the SMB share.
Despite having the ability to secure access to the share, a network administrator can sometimes make mistakes and accidentaly allow logins without any valid credentials or using either guest accounts
or anonymous log-ons
|
|
As previously mentioned, we observe that port 445 TCP for SMB is up and running, which means that we have an active share that we could potentially explore. Think of this share as a folder that can be accessed over the internet. In order to do so, we will need the appropriate services and scripts installed. In order to successfully enumerate share content on the remote system, we can use a script called
smbclient . If the script is not present on your Virtual Machine, you can install it by typing the following command in your terminal (for Debian based operating systems):
|
|
Smbclient will attempt to connect to the remote host and check if there is any authentication required. If there is, it will ask you for a password for your local username. We should take note of this. If we do not
specify a specific username to smbclient when attempting to connect to the remote host, it will just use your local machine’s username. That is the one you are currently logged into your Virtual Machine with. This is because SMB authentication always requires a username, so by not giving it one explicitly to try to login with, it will just have to pass your current local username to avoid throwing an error with the protocol.
Nevertheless, let us use our local username since we do not know about any remote usernames present on the target host that we could potentially log in with. Next up, after that, we will be prompted for a password. This password is related to the username you input before. Hypothetically, if we were a legitimate remote user trying to log in to their resource, we would know our username and password and log in normally to access our share. In this case, we do not have such credentials, so what we will be trying to perform is any of the following:
Guest authentication
Anonymous authentication
Any of these will result in us logging in without knowing a proper username/password combination and seeing the files stored on the share. Let us proceed to try that. We leave the password field blank, simply
hitting Enter
to tell the script to move along.
|
|
As always, we can type the name of our script in the terminal followed by the switch -h or --help
to find out more about the capabilities of this script alongside its usage.
ADMIN$
- Administrative shares are hidden network shares created by the Windows NT family of operating systems that allow system administrators to have remote access to every disk volume on a network-connected system. These shares may not be permanently deleted but may be disabled.
C$
- Administrative share for the C:\ disk volume. This is where the operating system is hosted.
IPC$
- The inter-process communication share. Used for inter-process communication via named pipes and is not part of the file system.
WorkShares
- Custom share.
|
|
Success! The WorkShares SMB share was poorly configured, allowing us to log in without the appropriate credentials. We can see our terminal prompt changed to smb: > , letting us know that our shell is now interacting with the service. We can use the help command to see what we can do within this shell.
|
|
smbget
is used to download remote shares files
|
|
|
|
flag is hidden on worknotes.txt