Crackmapexec is a one-stop tool for pentesting Windows and Active Directory. It contains all the tools and commands explained in the previous section and more. Some of the things that the tools is capable of doing are enumerating SMB shares, users and groups, spraying passwords, auto-injecting Mimikatz/shellcode/DLL into memory, etc.
Username & Password Spraying
Crackmapexec can be used to guess the username and password to an SMB service,
Various information can be enumerated from the SMB service such as the users, groups, shares, etc.
crackmapexec smb 192.168.1.10 -u 'user' -p 'PASS' --users
#Substitute the parameter with any of the following to fetch the respective info,
--groups --local-users --rid-brute "--local-auth --shares" --sessions --lusers --pass-pol