GO KALI FREE

CrackMapExec

Post Exploitation

Advancedhigh risk

CrackMapExec (CME) is a post-exploitation tool for pentesting Windows and Active Directory networks. It can enumerate users, spray passwords, execute commands, and move laterally.

Installation

sudo apt install crackmapexec

Basic Syntax

crackmapexec <protocol> <target> [options]

Quick Facts

Full Name
CrackMapExec (CME)
License
BSD
Language
Python
Interface
CLI
Category
Post Exploitation
Protocols
SMB, WinRM, MSSQL, SSH, LDAP

Tool Overview

CrackMapExec is a post-exploitation tool that automates the assessment of Windows Active Directory networks. It provides a comprehensive suite for enumerating hosts, spraying passwords, executing commands, and moving laterally across domains.

With modular protocol support and color-coded output, CME is the go-to tool for red teams and pentesters performing large-scale Active Directory security assessments.

Common Commands

crackmapexec smb 192.168.1.0/24Sweep a subnet for SMB hosts and show OS, hostname and signing
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS>Authenticate to a host over SMB with a username and password
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> -d example.comAuthenticate with an explicit domain
crackmapexec smb 10.10.10.10 -u <USER> -H <NTHASH>Pass-the-hash authentication using an NT hash
crackmapexec smb 192.168.1.0/24 -u <USER> -p <PASS> --local-authAuthenticate against local (non-domain) accounts
crackmapexec smb 10.10.10.10 -u users.txt -p passwords.txtTest a list of usernames and passwords for valid credentials
crackmapexec smb 192.168.1.0/24 -u <USER> -p passwords.txt --continue-on-successPassword-spray and keep going after the first valid hit
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --sharesList shares and the current user's read/write access
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --sessionsList active SMB sessions on the target
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --loggedon-usersShow users currently logged on to the host
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --usersEnumerate domain users
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --groupsEnumerate domain groups
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --pass-polDump the account/password policy
crackmapexec smb 10.10.10.10 -u '' -p '' --rid-bruteBrute-force RIDs to enumerate users via a null session
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> -x whoamiExecute an OS command on the target
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> -X "Get-Process"Execute a PowerShell command on the target
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --samDump local SAM password hashes
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --lsaDump LSA secrets and cached credentials
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> --ntdsDump NTDS.dit domain hashes from a Domain Controller
crackmapexec smb 10.10.10.10 -LList all available modules for the SMB protocol
crackmapexec smb 10.10.10.10 -u <USER> -p <PASS> -M mimikatzRun a module against the target
crackmapexec winrm 10.10.10.10 -u <USER> -p <PASS>Validate credentials over WinRM
crackmapexec mssql 10.10.10.10 -u <USER> -p <PASS> -q "SELECT @@version"Run a query against a Microsoft SQL Server
crackmapexec ldap 10.10.10.10 -u <USER> -p <PASS> --kerberoasting out.txtRequest and save Kerberoastable service tickets
crackmapexec ldap 10.10.10.10 -u <USER> -p <PASS> --asreproast out.txtCollect AS-REP roastable hashes for users without preauth
crackmapexec ssh 192.168.1.0/24 -u <USER> -p <PASS>Test SSH credentials across a subnet

Step-by-Step Guide

  1. 1Sweep the target subnets to locate active services
  2. 2Validate any collected usernames and passwords against the hosts
  3. 3Extract directory structures and user details using valid access
  4. 4Run system-level instructions if you have secured administrative rights
  5. 5Use your access to pivot to adjoining systems

Warnings

Use Cases

SMB Enumeration

Scan subnets for accessible SMB services.

Password Spraying

Test passwords across many accounts safely.

Lateral Movement

Spread across domain-joined systems.

Command Execution

Run commands on remote Windows hosts.

Key Features

Related Tools

Impacket

Post Exploitation

Impacket is a versatile collection of Python classes for working with network protocols. It features low-level programmatic access to packets alongside specific full-featured scripts for interacting with Windows domains.

BloodHound

Post Exploitation

BloodHound uses graph theory to reveal the hidden and often unintended relationships within an Active Directory or Azure environment, allowing attackers or defenders to identify complex attack paths.

Evil-WinRM

Post Exploitation

Learn how to use Evil-WinRM, a Ruby-based client for the Windows Remote Management (WinRM) protocol. This guide covers installation, your first connection, password, pass-the-hash and Kerberos authentication, file transfers and script execution, all for use in authorized lab environments.

NetExec

Post Exploitation

NetExec (formerly CrackMapExec successor) is a post-exploitation tool for enumerating and attacking Active Directory environments. It automates SMB, WinRM, LDAP, and SSH attacks across large networks with support for Kerberos, NTLM, and pass-the-hash authentication.

Empire

Post Exploitation

Empire is an open-source post-exploitation and command-and-control (C2) framework originally created by @harmj0y and now maintained by BC-Security. It uses PowerShell and Python-based agents to model adversarial persistent access behaviors for authorized security testing, red team engagements, and defensive detection engineering. Empire provides encrypted communications, modular capabilities, and a flexible agent system for extended operations against Windows and Linux environments.

Mimikatz

Post Exploitation

Mimikatz is a powerful post-exploitation tool that exposes vulnerabilities in Windows authentication protection mechanisms, capable of extracting plaintexts passwords, hashes, PINs, and kerberos tickets from memory.

Related Cybersecurity Guides

Active Directory · Advanced

Lateral Movement: Moving Through Network Environments

A comprehensive guide to lateral movement techniques in Windows networks including pass-the-hash, pass-the-ticket, PSExec, WMI, DCOM, and WinRM for authorized penetration testing.

Active Directory · Advanced

Pass-the-Hash: Understanding NTLM Authentication Attacks

An in-depth look at pass-the-hash attacks against NTLM authentication, how they work, real-world exploitation scenarios, detection techniques, and defense strategies.

Guides · Advanced

SMB Enumeration Complete Guide: Beginner to Advanced Windows Reconnaissance

A complete beginner-to-advanced SMB enumeration guide covering discovery, NetBIOS, share access, user enumeration, automation, troubleshooting, workflow design, and SMB tool selection.

Guides · Advanced

Enterprise Network Reconnaissance: Large-Scale Windows Environment Mapping

Guide to performing reconnaissance across large enterprise Windows networks including domain enumeration, Active Directory mapping, and automated tool integration.

Frequently Asked Questions

What is CrackMapExec used for?

CrackMapExec (CME) is a post-exploitation tool designed for automating Windows Active Directory security assessments. It supports SMB, WinRM, MSSQL, SSH, and LDAP protocols for lateral movement and enumeration.

How does CrackMapExec handle password spraying?

CME can test a single password against many usernames across multiple hosts. The --no-bruteforce flag enables password spraying mode, which is useful for testing password reuse without triggering account lockouts.

What does Pwn3d! mean in the output?

Pwn3d! indicates that the provided credentials have administrative or SYSTEM-level privileges on the target machine, meaning the user has complete control over that host.

Can CrackMapExec execute commands?

Yes, CME can execute commands via SMB (wmiexec/atexec), WinRM, and SSH modules, providing semi-interactive command execution on Windows and Linux targets.

Tags

#post-exploitation#windows#ad-environments

Output Explanation

Terminal output color-codes authentication attempts. A green plus indicates success, while a red minus indicates failure. If 'Pwn3d!' appears, the provided credentials hold administrative power over that specific machine.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.