https://nmap.org/nsedoc/scripts/smb-vuln-ms17-010.html
User Summary
Attempts to detect if a Microsoft SMBv1 server is vulnerable to a remote code execution vulnerability (ms17-010).The script connects to the $IPC tree, executes a transaction on FID 0 and checks if the error "STATUS_INSUFF_SERVER_RESOURCES" is returned to determine if the target is not patched against ms17-010. Additionally it checks for known error codes returned by patched systems.
Tested on Windows XP, 2003, 7, 8, 8.1, 10, 2008, 2012 and 2016.
Example Usage
nmap -p445 --script smb-vuln-ms17-010 <target>
nmap -p445 --script vuln <target>
https://medium.com/@zilmar/checando-vulnerabilidade-do-wannacry-com-uso-do-nmap-5f3cf9093299