Server Message Protocol (SMB)
The Server Message Block (SMB) protocol is a client-server communication protocol that is used for shared access to files, directories, printers, serial ports, and other resources on a network. It also provides an authenticated inter-process communication (IPC) mechanism.
Nmap provides some scripts which collect information from SMB. For example, nbstat or smb2-time.
One of the tools to enumerate this service is metasploit. For example, we can use the module auxiliary/scanner/smb/smb_version to get the SMB Version.
We can also use a tool called smbclient. This tool will allow us to connect to the remote SMB Share. If the share has anonymous access enabled, we can potentially see some sensitive files
We can add the -L parameter to enumerate the shares exposed in a certain host.
smbclient -L \\\\<IP>\\Then, to connect to a certain share, we just add the name of it.
smblcient \\\\<IP>\\<SHARE_NAME>If we successfully connect to a share, we can use the help command to get a list of available commands.