Obtaining system information from SMB
SMB is a protocol commonly found in Microsoft Windows clients that have matured through the years. Despite the newer versions available, SMBv1 can still be found enabled in most systems for compatibility reasons. SMBv1 has an interesting feature that has been abused for years, that is, that SMBv1 servers return system information pre-authentication. The information available includes the Windows version, build number, NetBIOS computer name, workgroup, and exact system time. This is valuable information as it allows us to fingerprint systems without the noise from OS detection scans.
This recipe shows how to obtain system information from SMB with Nmap.
How to do it...
Open your terminal and enter the following Nmap command:
$ nmap -p139,445 --script smb-os-discovery <target>
The smb-os-discovery
script will return valuable system information if SMBv1 is enabled:
PORT STATE SERVICE 445/tcp open ...