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

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

BloodHound

Post Exploitation

AD attack path mapping.

Impacket

Post Exploitation

Protocol toolkit for Windows networks.

Evil-WinRM

Post Exploitation

WinRM-based remote shell.

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.