mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-12 11:52:01 +01:00
fixes to the script for when multiple accounts are logged on on target and Meterpreter is running as system.
git-svn-id: file:///home/svn/framework3/trunk@10358 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
012654947a
commit
16ae3c84e9
@ -20,7 +20,7 @@ opts.parse(args) { |opt, idx, val|
|
||||
# Function for enumerating recent mapped drives on target machine
|
||||
def enum_recent_mounts(base_key)
|
||||
recent_mounts = []
|
||||
partial_path = "#{base_key}\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"
|
||||
partial_path = base_key + '\Software\\Microsoft\Windows\CurrentVersion\Explorer'
|
||||
full_path = "#{partial_path}\\Map Network Drive MRU"
|
||||
explorer_keys = registry_enumkeys(partial_path)
|
||||
if explorer_keys.include?("Map Network Drive MRU")
|
||||
@ -36,7 +36,7 @@ end
|
||||
# Function for enumerating UNC Paths entered in run dialog box
|
||||
def enum_run_unc(base_key)
|
||||
unc_paths = []
|
||||
full_path = "#{base_key}\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU"
|
||||
full_path = base_key + '\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU'
|
||||
registry_enumvals(full_path).each do |k|
|
||||
if k =~ /./
|
||||
run_entrie = registry_getvaldata(full_path,k)
|
||||
@ -90,8 +90,8 @@ if client.platform =~ /win32|64/
|
||||
user_sid << k if k =~ /S-1-5-21-\d*-\d*-\d*-\d{3,6}$/
|
||||
end
|
||||
user_sid.each do |us|
|
||||
mount_history + enum_recent_mounts("HKCU\\#{us.chomp}")
|
||||
run_history + enum_run_unc("HKCU\\#{us.chomp}")
|
||||
mount_history = mount_history + enum_recent_mounts("HKU\\#{us.chomp}")
|
||||
run_history = run_history + enum_run_unc("HKU\\#{us.chomp}")
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user