Path: blob/master/modules/post/windows/gather/enum_emet.rb
19813 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::Windows::Registry7include Msf::Post::Common89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Windows Gather EMET Protected Paths',14'Description' => %q{ This module will enumerate the EMET protected paths on the target host.},15'License' => MSF_LICENSE,16'Author' => [ 'vysec <vincent.yiu[at]mwrinfosecurity.com>' ],17'Platform' => [ 'win' ],18'SessionTypes' => [ 'meterpreter' ],19'Notes' => {20'Stability' => [CRASH_SAFE],21'SideEffects' => [],22'Reliability' => []23}24)25)26end2728def print_status(msg = '')29super("#{peer} - #{msg}")30end3132def print_good(msg = '')33super("#{peer} - #{msg}")34end3536def run37reg_view = sysinfo['Architecture'] == ARCH_X64 ? REGISTRY_VIEW_64_BIT : REGISTRY_VIEW_32_BIT38reg_vals = registry_enumvals('HKLM\\SOFTWARE\\Microsoft\\EMET\\AppSettings', reg_view)39if reg_vals.nil?40print_error('Failed to enumerate EMET Protected.')41else42print_status('Found protected processes:')43reg_vals.each do |path|44print_status(path)45end46path = store_loot('host.emet_paths', 'text/plain', session, reg_vals.join("\r\n"), 'emet_paths.txt', 'EMET Paths')47print_good("Results stored in: #{path}")48end49end50end515253