CrackMapExec (CME) is a versatile and powerful tool for pentesters and red teamers who want to perform various attacks and operations on Windows networks using the Server Message Block (SMB) protocol. SMB is a network file sharing protocol that allows users to access files, printers, and other resources on a remote server. SMB is also used for authentication, authorization, and communication between Windows hosts.
In this article, we will provide a simple and concise cheat sheet for using CME to perform common tasks such as enumeration, credential spraying, command execution, and credential dumping using SMB. We will assume that you have already installed CME on your system and that you have a valid username and password or hash to authenticate to the target network. We will also use the following notation:
Enumeration is the process of gathering information about the target network, such as live hosts, shares, sessions, users, groups, policies, etc. CME provides various options to perform enumeration using SMB. Here are some examples:
To scan the target network for live hosts and their basic information, such as OS version, name, domain, signing status, and SMB version, use the following command:
cme smb 10.0.0.0/24This will output something like this:
SMB 10.0.0.1 445 DC01 [*] Windows Server 2019 Standard 17763 x64 (name:DC01) (domain:DOMAIN) (signing:True) (SMBv1:False)To enumerate the available shares on the target hosts and check their access permissions, use the following command:
cme smb 10.0.0.0/24 -u UserName -p 'PASS' --sharesThis will output something like this:
SMB 10.0.0.1 445 DC01 [+] DOMAIN\UserName:PASSTo enumerate the active sessions on the target hosts and get their usernames and source IPs, use the following command:
cme smb 10 e8e8a447ac