Browse Source

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-b9f4589650
Carlos Perez 9 years ago
parent
commit
16ae3c84e9
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      scripts/meterpreter/enum_shares.rb

+ 4
- 4
scripts/meterpreter/enum_shares.rb View File

@@ -20,7 +20,7 @@ opts.parse(args) { |opt, idx, val|
20 20
 # Function for enumerating recent mapped drives on target machine
21 21
 def enum_recent_mounts(base_key)
22 22
 	recent_mounts = []
23
-	partial_path = "#{base_key}\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"
23
+	partial_path = base_key + '\Software\\Microsoft\Windows\CurrentVersion\Explorer'
24 24
 	full_path = "#{partial_path}\\Map Network Drive MRU"
25 25
 	explorer_keys = registry_enumkeys(partial_path)
26 26
 	if explorer_keys.include?("Map Network Drive MRU")
@@ -36,7 +36,7 @@ end
36 36
 # Function for enumerating UNC Paths entered in run dialog box
37 37
 def enum_run_unc(base_key)
38 38
 	unc_paths = []
39
-	full_path = "#{base_key}\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU"
39
+	full_path = base_key + '\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU'
40 40
 	registry_enumvals(full_path).each do |k|
41 41
 		if k =~ /./
42 42
 			run_entrie = registry_getvaldata(full_path,k)
@@ -90,8 +90,8 @@ if client.platform =~ /win32|64/
90 90
 			user_sid << k if k =~ /S-1-5-21-\d*-\d*-\d*-\d{3,6}$/
91 91
 		end
92 92
 		user_sid.each do |us|
93
-			mount_history +  enum_recent_mounts("HKCU\\#{us.chomp}")
94
-			run_history + enum_run_unc("HKCU\\#{us.chomp}")
93
+			mount_history = mount_history + enum_recent_mounts("HKU\\#{us.chomp}")
94
+			run_history = run_history + enum_run_unc("HKU\\#{us.chomp}")
95 95
 		end
96 96
 	end
97 97
 

Loading…
Cancel
Save