@@ -14,7 +14,7 @@ class Metasploit3 < Msf::Post
14
14
def initialize ( info = { } )
15
15
super ( update_info ( info ,
16
16
'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.} ,
18
18
'License' => MSF_LICENSE ,
19
19
'Author' => [ 'TJ Glad <fraktaali[at]gmail.com>' ] ,
20
20
'Platform' => [ 'win' ] ,
@@ -33,9 +33,9 @@ def prefetch_key_value()
33
33
elsif key_value == 1
34
34
print_good ( "EnablePrefetcher Value: (1) = Application launch prefetching enabled (Non-Default)." )
35
35
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 )." )
37
37
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 )." )
39
39
else
40
40
print_error ( "No value or unknown value. Results might vary." )
41
41
end
@@ -120,15 +120,16 @@ def run
120
120
121
121
# Check to see what Windows Version is running.
122
122
# Needed for offsets.
123
- # Tested on WinXP and Win7 systems. Should work on WinVista & Win2k3. .
123
+ # Tested on WinXP, Win2k3 and Win7 systems.
124
124
# http://www.forensicswiki.org/wiki/Prefetch
125
125
# http://www.forensicswiki.org/wiki/Windows_Prefetch_File_Format
126
126
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."
128
129
129
130
if sysnfo =~/(Windows XP)/
130
131
if not is_system?
131
- print_error ( "You don't have enough privileges. Try getsystem." )
132
+ print_error ( error_msg )
132
133
return nil
133
134
end
134
135
# Offsets for WinXP
@@ -140,9 +141,23 @@ def run
140
141
# Registry key for timezone
141
142
key_value = "StandardName"
142
143
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
+
143
158
elsif sysnfo =~/(Windows 7)/
144
159
if not is_admin?
145
- print_error ( "You don't have enough privileges. Try getsystem." )
160
+ print_error ( error_msg )
146
161
return nil
147
162
end
148
163
# Offsets for Win7
@@ -155,7 +170,7 @@ def run
155
170
key_value = "TimeZoneKeyName"
156
171
157
172
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." )
159
174
return nil
160
175
end
161
176
@@ -171,10 +186,7 @@ def run
171
186
"Filename"
172
187
] )
173
188
174
- print_status ( "Searching for Prefetch Registry Value." )
175
-
176
189
prefetch_key_value
177
- print_status ( "Searching for TimeZone Registry Values." )
178
190
179
191
timezone_key_values ( key_value )
180
192
0 commit comments