Skip to content

Commit 8602e74

Browse files
committed
Add support for Win2k3
1 parent f3bb0ec commit 8602e74

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

modules/post/windows/gather/enum_prefetch.rb

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Metasploit3 < Msf::Post
1414
def initialize(info={})
1515
super(update_info(info,
1616
'Name' => 'Windows Gather Prefetch File Information',
17-
'Description' => %q{This module gathers prefetch file information from WinXP & Win7 systems.},
17+
'Description' => %q{This module gathers prefetch file information from WinXP, Win2k3 and Win7 systems.},
1818
'License' => MSF_LICENSE,
1919
'Author' => ['TJ Glad <fraktaali[at]gmail.com>'],
2020
'Platform' => ['win'],
@@ -33,9 +33,9 @@ def prefetch_key_value()
3333
elsif key_value == 1
3434
print_good("EnablePrefetcher Value: (1) = Application launch prefetching enabled (Non-Default).")
3535
elsif key_value == 2
36-
print_good("EnablePrefetcher Value: (2) = Boot prefetching enabled (Non-Default).")
36+
print_good("EnablePrefetcher Value: (2) = Boot prefetching enabled (Non-Default, excl. Win2k3).")
3737
elsif key_value == 3
38-
print_good("EnablePrefetcher Value: (3) = Applaunch and boot enabled (Default Value).")
38+
print_good("EnablePrefetcher Value: (3) = Applaunch and boot enabled (Default Value, excl. Win2k3).")
3939
else
4040
print_error("No value or unknown value. Results might vary.")
4141
end
@@ -120,15 +120,16 @@ def run
120120

121121
# Check to see what Windows Version is running.
122122
# Needed for offsets.
123-
# Tested on WinXP and Win7 systems. Should work on WinVista & Win2k3..
123+
# Tested on WinXP, Win2k3 and Win7 systems.
124124
# http://www.forensicswiki.org/wiki/Prefetch
125125
# http://www.forensicswiki.org/wiki/Windows_Prefetch_File_Format
126126

127-
sysnfo = client.sys.config.sysinfo['OS']
127+
sysnfo = client.sys.config.sysinfo['OS']
128+
error_msg = "You don't have enough privileges. Try getsystem."
128129

129130
if sysnfo =~/(Windows XP)/
130131
if not is_system?
131-
print_error("You don't have enough privileges. Try getsystem.")
132+
print_error(error_msg)
132133
return nil
133134
end
134135
# Offsets for WinXP
@@ -140,9 +141,23 @@ def run
140141
# Registry key for timezone
141142
key_value = "StandardName"
142143

144+
elsif sysnfo =~/(Windows .NET Server)/
145+
if not is_system?
146+
print_error(error_msg)
147+
return nil
148+
end
149+
# Offsets for Win2k3
150+
print_good("Detected Windows 2k3 (max 128 entries)")
151+
name_offset = 0x10
152+
hash_offset = 0x4C
153+
lastrun_offset = 0x78
154+
runcount_offset = 0x90
155+
# Registry key for timezone
156+
key_value = "StandardName"
157+
143158
elsif sysnfo =~/(Windows 7)/
144159
if not is_admin?
145-
print_error("You don't have enough privileges. Try getsystem.")
160+
print_error(error_msg)
146161
return nil
147162
end
148163
# Offsets for Win7
@@ -155,7 +170,7 @@ def run
155170
key_value = "TimeZoneKeyName"
156171

157172
else
158-
print_error("No offsets for the target Windows version. Currently works only on WinXP and Win7.")
173+
print_error("No offsets for the target Windows version. Currently works only on WinXP, Win2k3 and Win7.")
159174
return nil
160175
end
161176

@@ -171,10 +186,7 @@ def run
171186
"Filename"
172187
])
173188

174-
print_status("Searching for Prefetch Registry Value.")
175-
176189
prefetch_key_value
177-
print_status("Searching for TimeZone Registry Values.")
178190

179191
timezone_key_values(key_value)
180192

0 commit comments

Comments
 (0)