Windows MessageBox - Metasploit


This page contains detailed information about how to use the payload/windows/messagebox metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Windows MessageBox
Module: payload/windows/messagebox
Source code: modules/payloads/singles/windows/messagebox.rb
Disclosure date: -
Last modification time: 2020-02-25 16:49:59 +0000
Supported architecture(s): x86
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

Spawns a dialog via MessageBox using a customizable title, text & icon

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 payload/windows/messagebox
msf payload(messagebox) > show options
    ... show and set options ...
msf payload(messagebox) > generate

To learn how to generate payload/windows/messagebox with msfvenom, please read this.

Go back to menu.

Msfconsole Usage


Here is how the windows/messagebox payload looks in the msfconsole:

msf6 > use payload/windows/messagebox

msf6 payload(windows/messagebox) > show info

       Name: Windows MessageBox
     Module: payload/windows/messagebox
   Platform: Windows
       Arch: x86
Needs Admin: No
 Total size: 272
       Rank: Normal

Provided by:
  corelanc0d3r <[email protected]>
  jduck <[email protected]>

Basic options:
Name      Current Setting   Required  Description
----      ---------------   --------  -----------
EXITFUNC  process           yes       Exit technique (Accepted: '', seh, thread, process, none)
ICON      NO                yes       Icon type can be NO, ERROR, INFORMATION, WARNING or QUESTION
TEXT      Hello, from MSF!  yes       Messagebox Text (max 255 chars) Max parameter length: 255 characters
TITLE     MessageBox        yes       Messagebox Title (max 255 chars) Max parameter length: 255 characters

Description:
  Spawns a dialog via MessageBox using a customizable title, text & 
  icon

Module Options


This is a complete list of options available in the windows/messagebox payload:

msf6 payload(windows/messagebox) > show options

Module options (payload/windows/messagebox):

   Name      Current Setting   Required  Description
   ----      ---------------   --------  -----------
   EXITFUNC  process           yes       Exit technique (Accepted: '', seh, thread, process, none)
   ICON      NO                yes       Icon type can be NO, ERROR, INFORMATION, WARNING or QUESTION
   TEXT      Hello, from MSF!  yes       Messagebox Text (max 255 chars) Max parameter length: 255 characters
   TITLE     MessageBox        yes       Messagebox Title (max 255 chars) Max parameter length: 255 characters

Advanced Options


Here is a complete list of advanced options supported by the windows/messagebox payload:

msf6 payload(windows/messagebox) > show advanced

Module advanced options (payload/windows/messagebox):

   Name                Current Setting  Required  Description
   ----                ---------------  --------  -----------
   PrependMigrate      false            yes       Spawns and runs shellcode in new process
   PrependMigrateProc                   no        Process to spawn and run shellcode in
   VERBOSE             false            no        Enable detailed status messages
   WORKSPACE                            no        Specify the workspace for this module

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.

ICON


Here is a relevant code snippet related to the "ICON" error message:

27:	    # Register MessageBox options
28:	    register_options(
29:	      [
30:	        OptString.new('TITLE', [ true, "Messagebox Title (max 255 chars)", "MessageBox" ], max_length: 255),
31:	        OptString.new('TEXT', [ true, "Messagebox Text (max 255 chars)", "Hello, from MSF!" ], max_length: 255),
32:	        OptString.new('ICON', [ true, "Icon type can be NO, ERROR, INFORMATION, WARNING or QUESTION", "NO" ])
33:	      ])
34:	  end
35:	
36:	  #
37:	  # Construct the payload

You must specify a title


Here is a relevant code snippet related to the "You must specify a title" error message:

38:	  #
39:	  def generate
40:	
41:	    strTitle = datastore['TITLE'] + "X"
42:	    if (strTitle.length < 1)
43:	      raise ArgumentError, "You must specify a title"
44:	    end
45:	
46:	    strText = datastore['TEXT'] + "X"
47:	    if (strText.length < 1)
48:	      raise ArgumentError, "You must specify the text of the MessageBox"

You must specify the text of the MessageBox


Here is a relevant code snippet related to the "You must specify the text of the MessageBox" error message:

43:	      raise ArgumentError, "You must specify a title"
44:	    end
45:	
46:	    strText = datastore['TEXT'] + "X"
47:	    if (strText.length < 1)
48:	      raise ArgumentError, "You must specify the text of the MessageBox"
49:	    end
50:	
51:	    # exitfunc process or thread ?
52:	    stackspace = "0x04"
53:	    funchash = ""

ERROR


Here is a relevant code snippet related to the "ERROR" error message:

106:	
107:	    # generate code to set messagebox icon
108:	    setstyle = "push edx\n\t"
109:	    case datastore['ICON'].upcase.strip
110:	      #default = NO
111:	    when 'ERROR'
112:	      setstyle = "push 0x10\n\t"
113:	    when 'QUESTION'
114:	      setstyle = "push 0x20\n\t"
115:	    when 'WARNING'
116:	      setstyle = "push 0x30\n\t"

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • corelanc0d3r <peter.ve[at]corelan.be>
  • jduck

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.