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.


References


See Also


Check also the following modules related to this module:

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.