Generic Emailer (SMTP) - Metasploit
This page contains detailed information about how to use the auxiliary/client/smtp/emailer metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Generic Emailer (SMTP)
Module: auxiliary/client/smtp/emailer
Source code: modules/auxiliary/client/smtp/emailer.rb
Disclosure date: -
Last modification time: 2020-05-30 10:27:48 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: smtp, smtps
Target network port(s): 25, 465, 587, 2525, 25000, 25025
List of CVEs: -
This module can be used to automate email delivery. This code is based on Joshua Abraham's email script for social engineering.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
msf > use auxiliary/client/smtp/emailer
msf auxiliary(emailer) > show targets
... a list of targets ...
msf auxiliary(emailer) > set TARGET target-id
msf auxiliary(emailer) > show options
... show and set options ...
msf auxiliary(emailer) > exploit
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Go back to menu.
Msfconsole Usage
Here is how the client/smtp/emailer auxiliary module looks in the msfconsole:
msf6 > use auxiliary/client/smtp/emailer
msf6 auxiliary(client/smtp/emailer) > show info
Name: Generic Emailer (SMTP)
Module: auxiliary/client/smtp/emailer
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
et <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
DATE no Override the DATE: field with this value
DOMAIN no SMTP Domain to EHLO to
MAILFROM [email protected] yes The FROM address of the e-mail
PASSWORD no SMTP Password for sending email
RHOST 127.0.0.1 yes SMTP server address
RHOSTS 127.0.0.1 yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 25 yes SMTP server port (TCP)
USERNAME no SMTP Username for sending email
VERBOSE no Display verbose information
YAML_CONFIG /opt/metasploit-framework/embedded/framework/data/emailer_config.yaml yes Full path to YAML Configuration file
Description:
This module can be used to automate email delivery. This code is
based on Joshua Abraham's email script for social engineering.
References:
http://spl0it.org/
Module Options
This is a complete list of options available in the client/smtp/emailer auxiliary module:
msf6 auxiliary(client/smtp/emailer) > show options
Module options (auxiliary/client/smtp/emailer):
Name Current Setting Required Description
---- --------------- -------- -----------
DATE no Override the DATE: field with this value
DOMAIN no SMTP Domain to EHLO to
MAILFROM [email protected] yes The FROM address of the e-mail
PASSWORD no SMTP Password for sending email
RHOST 127.0.0.1 yes SMTP server address
RHOSTS 127.0.0.1 yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 25 yes SMTP server port (TCP)
USERNAME no SMTP Username for sending email
VERBOSE no Display verbose information
YAML_CONFIG /opt/metasploit-framework/embedded/framework/data/emailer_config.yaml yes Full path to YAML Configuration file
Advanced Options
Here is a complete list of advanced options supported by the client/smtp/emailer auxiliary module:
msf6 auxiliary(client/smtp/emailer) > show advanced
Module advanced options (auxiliary/client/smtp/emailer):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
ConnectTimeout 10 yes Maximum number of seconds to establish a TCP connection
EXE::Custom no Use custom exe instead of automatically generating a payload exe
EXE::EICAR false no Generate an EICAR file instead of regular payload exe
EXE::FallBack false no Use the default template in case the specified one is missing
EXE::Inject false no Set to preserve the original EXE function
EXE::OldMethod false no Set to use the substitution EXE generation method.
EXE::Path no The directory in which to look for the executable template
EXE::Template no The executable template file name.
MSI::Custom no Use custom msi instead of automatically generating a payload msi
MSI::EICAR false no Generate an EICAR file instead of regular payload msi
MSI::Path no The directory in which to look for the msi template
MSI::Template no The msi template file name
MSI::UAC false no Create an MSI with a UAC prompt (elevation to SYSTEM if accepted)
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCipher no String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
SSLVerifyMode PEER no SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
SSLVersion Auto yes Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the client/smtp/emailer module can do:
msf6 auxiliary(client/smtp/emailer) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the client/smtp/emailer auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(client/smtp/emailer) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
TCP::max_send_size 0 no Maxiumum tcp segment size. (0 = disable)
TCP::send_delay 0 no Delays inserted before every send. (0 = disable)
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
YAML config: <TYPE>
Here is a relevant code snippet related to the "YAML config: <TYPE>" error message:
116: datastore['MAILFROM'] = from
117:
118: msg = load_file(msg_file)
119:
120: if (type !~ /text/i and type !~ /text\/html/i)
121: print_error("YAML config: #{type}")
122: end
123:
124: if make_payload
125: attachment_file = File.join(tmp, msf_filename)
126: attachment_file_name = msf_filename
Failed to create payload, <MSF_PAYLOAD>
Here is a relevant code snippet related to the "Failed to create payload, <MSF_PAYLOAD>" error message:
126: attachment_file_name = msf_filename
127:
128: print_status("Creating payload...")
129: mod = framework.payloads.create(msf_payload)
130: if (not mod)
131: print_error("Failed to create payload, #{msf_payload}")
132: return
133: end
134:
135: # By not passing an explicit encoder, we're asking the
136: # framework to pick one for us. In general this is the best
Go back to menu.
Related Pull Requests
- #13540 Merged Pull Request: Change OptString of RPORT to OptPort
- #11310 Merged Pull Request: Don't use system() to ZIP files in auxiliary/client/smtp/emailer
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6854 Merged Pull Request: Don't duplicate headers when sending emails
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #2525 Merged Pull Request: Change module boilerplate
- #2426 Merged Pull Request: Find and replace Msf::Config.install_root, "data"
- #2243 Merged Pull Request: [FixRM #8312] - Fix file handle leaks
- #1228 Merged Pull Request: MSFTIDY cleanup #1 - auxiliary
References
See Also
Check also the following modules related to this module:
- auxiliary/dos/smtp/sendmail_prescan
- auxiliary/dos/windows/smtp/ms06_019_exchange
- auxiliary/fuzzers/smtp/smtp_fuzzer
- auxiliary/scanner/smtp/smtp_enum
- auxiliary/scanner/smtp/smtp_ntlm_domain
- auxiliary/scanner/smtp/smtp_relay
- auxiliary/scanner/smtp/smtp_version
- auxiliary/client/hwbridge/connect
- auxiliary/client/iec104/iec104
- auxiliary/client/mms/send_mms
- auxiliary/client/sms/send_text
- auxiliary/client/telegram/send_message
- exploit/linux/smtp/apache_james_exec
- exploit/linux/smtp/exim4_dovecot_exec
- exploit/linux/smtp/exim_gethostbyname_bof
- exploit/linux/smtp/haraka
- exploit/unix/smtp/clamav_milter_blackhole
- exploit/unix/smtp/exim4_string_format
- exploit/unix/smtp/morris_sendmail_debug
- exploit/unix/smtp/opensmtpd_mail_from_rce
- exploit/unix/smtp/qmail_bash_env_exec
- exploit/windows/smtp/mailcarrier_smtp_ehlo
- exploit/windows/smtp/mercury_cram_md5
- exploit/windows/smtp/ms03_046_exchange2000_xexch50
- exploit/windows/smtp/njstar_smtp_bof
- exploit/windows/smtp/sysgauge_client_bof
- exploit/windows/smtp/wmailserver
- exploit/windows/smtp/ypops_overflow1
- auxiliary/scanner/http/wp_easy_wp_smtp
- auxiliary/server/capture/smtp
- exploit/unix/local/opensmtpd_oob_read_lpe
Authors
- et <et[at]metasploit.com>
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.