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/enum_av.rb
Views: 11655
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::Windows::Priv78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Windows Installed AntiVirus Enumeration',13'Description' => %q{14This module will enumerate the AV products detected by WMIC15},16'License' => MSF_LICENSE,17'Author' => [ 'rageltman <rageltman[at]sempervictus>' ],18'Platform' => %w[win],19'SessionTypes' => [ 'meterpreter', 'shell' ],20'Notes' => {21'Stability' => [CRASH_SAFE],22'Reliability' => [],23'SideEffects' => []24}25)26)27end2829# Run Method for when run command is issued30def run31if command_exists?('wmic') == false32print_error("The 'wmic' command doesn't exist on this host!") # wmic is technically marked as deprecated so this command could very well be removed in future releases.33return34end35avs = {}36cmd = 'wmic /namespace:\\\\root\\SecurityCenter2 path AntiVirusProduct get * /value'37resp = cmd_exec(cmd, nil, 6000).to_s38fail_with(Failure::Unknown, resp) if resp[0..5].upcase == 'ERROR:'39resp.split("\r\r\n\r\r\n").map do |ent|40next if ent.strip.empty?4142print_status("Found AV product:\n#{ent}\n")43av_note = ent.lines.map(&:strip).map.select { |e| e.length > 1 }.map { |e| e.split('=', 2) }.to_h44avn = av_note.delete('displayName')45avs[avn] = av_note46end47report_note(host: target_host, type: 'windows.antivirus', data: avs, update: :unique_data)48end49end505152