PowerCat - Empire Module


This page contains detailed information about how to use the powershell/management/powercat Empire module. For list of all Empire modules, visit the Empire Module Library.

Module Overview


Name: PowerCat
Module: powershell/management/powercat
Source code [1]: empire/server/modules/powershell/management/powercat.yaml
Source code [2]: empire/server/data/module_source/management/powercat.ps1
MITRE ATT&CK: T1036
Language: PowerShell
Needs admin: No
OPSEC safe: Yes
Background: Yes

powercat is a powershell function. First you need to load the function before you can execute it.You can put one of the below commands into your powershell profile so powercat is automaticallyloaded when powershell starts..

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 powercat 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 powercat module:

Agent
Agent to run module on.

Additional Module Options


This is a list of additional options that are supported by the powercat module:

c
Connect to a listener.

d
Switch. Disconnect after connecting.

dns
Transfer data over dns (dnscat2).

dnsft
DNS Failure Threshold.

e
Execute. (GAPING_SECURITY_HOLE).

ep
Switch. Execute Powershell.

g
Switch. Generate Payload.

ge
Switch. Generate Encoded Payload.

i
Input: Filepath (string), byte array, or string.

l
Switch. Listen for a connection.

o
Console Output Type: "Host", "Bytes", or "String".

of
Output File Path.

p
The port to connect to, or listen on.

r
Switch. Relay. Format: -r tcp:10.1.1.1:443.

rep
Switch. Repeater. Restart after disconnecting.

t
Timeout option. Default: 60.

u
Switch. Transfer data over UDP.

Powercat Example Usage


Here's an example of how to use the powercat 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 powershell/management/powercat

 Author       besimorhino                                                            
 Background   True                                                                   
 Comments     https://github.com/besimorhino/powercat                                
 Description  powercat is a powershell function. First you need to load the function 
              before you can execute it.You can put one of the below commands into   
              your powershell profile so powercat is automaticallyloaded when        
              powershell starts..                                                    
 Language     powershell                                                             
 Name         powershell/management/powercat                                         
 NeedsAdmin   False                                                                  
 OpsecSafe    True                                                                   
 Techniques   http://attack.mitre.org/techniques/T1036                               


,Record Options-,----------,-----------------------------------,
| Name  | Value | Required | Description                       |
|-------|-------|----------|-----------------------------------|
| Agent |       | True     | Agent to run module on.           |
|-------|-------|----------|-----------------------------------|
| c     |       | False    | Connect to a listener             |
|-------|-------|----------|-----------------------------------|
| d     |       | False    | Switch. Disconnect after          |
|       |       |          | connecting.                       |
|-------|-------|----------|-----------------------------------|
| dns   |       | False    | Transfer data over dns (dnscat2). |
|-------|-------|----------|-----------------------------------|
| dnsft |       | False    | DNS Failure Threshold.            |
|-------|-------|----------|-----------------------------------|
| e     |       | False    | Execute. (GAPING_SECURITY_HOLE)   |
|-------|-------|----------|-----------------------------------|
| ep    |       | False    | Switch. Execute Powershell.       |
|-------|-------|----------|-----------------------------------|
| g     |       | False    | Switch. Generate Payload          |
|-------|-------|----------|-----------------------------------|
| ge    |       | False    | Switch. Generate Encoded Payload  |
|-------|-------|----------|-----------------------------------|
| i     |       | False    | Input: Filepath (string), byte    |
|       |       |          | array, or string.                 |
|-------|-------|----------|-----------------------------------|
| l     |       | False    | Switch. Listen for a connection   |
|-------|-------|----------|-----------------------------------|
| o     |       | False    | Console Output Type: "Host",      |
|       |       |          | "Bytes", or "String"              |
|-------|-------|----------|-----------------------------------|
| of    |       | False    | Output File Path.                 |
|-------|-------|----------|-----------------------------------|
| p     |       | False    | The port to connect to, or listen |
|       |       |          | on.                               |
|-------|-------|----------|-----------------------------------|
| r     |       | False    | Switch. Relay. Format: -r         |
|       |       |          | tcp:10.1.1.1:443                  |
|-------|-------|----------|-----------------------------------|
| rep   |       | False    | Switch. Repeater. Restart after   |
|       |       |          | disconnecting.                    |
|-------|-------|----------|-----------------------------------|
| t     |       | False    | Timeout option. Default: 60       |
|-------|-------|----------|-----------------------------------|
| u     |       | False    | Switch. Transfer data over UDP.   |
'-------'-------'----------'-----------------------------------'

(Empire: usemodule/powershell/management/powercat) > set Agent Y4LHEV83
[*] Set Agent to Y4LHEV83
(Empire: usemodule/powershell/management/powercat) > execute
[*] Tasked Y4LHEV83 to run Task 1
...

Now wait for the results to come.

Author


  • besimorhino

References


See Also


Check also the following modules related to this module:

Version


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