View-Email - Empire Module
This page contains detailed information about how to use the powershell/management/mailraider/view_email Empire module. For list of all Empire modules, visit the Empire Module Library.
Module Overview
Name: View-Email
Module: powershell/management/mailraider/view_email
Source code [1]: empire/server/modules/powershell/management/mailraider/view_email.yaml
Source code [2]: empire/server/data/module_source/management/MailRaider.ps1
MITRE ATT&CK:
T1114
Language: PowerShell
Needs admin: No
OPSEC safe: Yes
Background: Yes
The view_email module selects the specified folder and then outputs the email item at the specified index.
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 view_email 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 view_email module:
Agent
Agent to run module on.
FolderName
The Name of the Outlook Default Folder.
Default value: Inbox
.
Index
Index of the Email item within the selected folder to display.
Additional Module Options
This is a list of additional options that are supported by the view_email module:
OutputFunction
PowerShell's output function to use ("Out-String", "ConvertTo-Json", "ConvertTo-Csv", "ConvertTo-Html", "ConvertTo-Xml").
Default value: Out-String
.
Suggested values: Out-String
, ConvertTo-Json
, ConvertTo-Csv
, ConvertTo-Html
, ConvertTo-Xml
.
View_email Example Usage
Here's an example of how to use the view_email 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/mailraider/view_email
Author @xorrior
Background True
Comments https://github.com/xorrior/EmailRaider
http://www.xorrior.com/phishing-on-the-inside/
Description Selects the specified folder and then outputs the email item at the
specified index.
Language powershell
Name powershell/management/mailraider/view_email
NeedsAdmin False
OpsecSafe True
Techniques http://attack.mitre.org/techniques/T1114
,Record Options--,------------,----------,-------------------------------------,
| Name | Value | Required | Description |
|----------------|------------|----------|-------------------------------------|
| Agent | | True | Agent to run module on. |
|----------------|------------|----------|-------------------------------------|
| FolderName | Inbox | True | The Name of the Outlook Default |
| | | | Folder. |
|----------------|------------|----------|-------------------------------------|
| Index | 0 | True | Index of the Email item within the |
| | | | selected folder to display. |
|----------------|------------|----------|-------------------------------------|
| OutputFunction | Out-String | False | PowerShell's output function to use |
| | | | ("Out-String", "ConvertTo-Json", |
| | | | "ConvertTo-Csv", "ConvertTo-Html", |
| | | | "ConvertTo-Xml"). |
'----------------'------------'----------'-------------------------------------'
(Empire: usemodule/powershell/management/mailraider/view_email) > set Agent Y4LHEV83
[*] Set Agent to Y4LHEV83
(Empire: usemodule/powershell/management/mailraider/view_email) > set FolderName Inbox
[*] Set FolderName to Inbox
(Empire: usemodule/powershell/management/mailraider/view_email) > set Index value
[*] Set Index to value
(Empire: usemodule/powershell/management/mailraider/view_email) > execute
[*] Tasked Y4LHEV83 to run Task 1
...
Now wait for the results to come.
Author
References
- https://github.com/BC-SECURITY/Empire/tree/master/empire/server/modules/powershell/management/mailraider/view_email.yaml
- https://github.com/BC-SECURITY/Empire/tree/master/empire/server/data/module_source/management/MailRaider.ps1
- https://github.com/xorrior/EmailRaider
- http://www.xorrior.com/phishing-on-the-inside/
- http://attack.mitre.org/techniques/T1114
- http://bigorg.com/projections.xls
- https://social.technet.microsoft.com/forums/windowsserver/en-US/6b25cbd2-2bff-4820-ab53-796e306066eb/defining-custom-outlook-rules-using-powershell
- https://github.com/PowerShellEmpire/PowerTools/blob/master/PowerView/powerview.ps1#L5672
See Also
Check also the following modules related to this module:
- powershell/management/mailraider/get_subfolders
- powershell/management/mailraider/mail_search
- powershell/management/mailraider/send_mail
- powershell/management/mailraider/search_gal
- powershell/management/mailraider/get_emailitems
- powershell/management/mailraider/disable_security
- python/collection/osx/search_email
Version
This page has been created based on Empire version 4.1.3 (BC Security Fork).
Visit Empire Module Library for more modules.