Skip to content

Commit e13f4f5

Browse files
committed
Minor fix
1 parent ef82308 commit e13f4f5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

modules/post/windows/gather/enum_prefetch.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def gather_prefetch_info(name_offset, hash_offset, lastrun_offset, runcount_offs
9292
client.railgun.kernel32.SetFilePointer(handle, hash_offset, 0, nil)
9393
hash = client.railgun.kernel32.ReadFile(handle, 4, 4, 4, nil)
9494

95-
# Finds the LastModified timestamp (MACE)
95+
# Finds the LastModified/Created timestamp (MACE)
9696
lm = client.priv.fs.get_file_mace(filename)
9797

9898
# Finds the Creation timestamp (MACE)
@@ -119,12 +119,6 @@ def run
119119

120120
print_status("Prefetch Gathering started.")
121121

122-
if not is_admin?
123-
print_error("You don't have enough privileges. Try getsystem.")
124-
return nil
125-
end
126-
127-
128122
begin
129123

130124
# Check to see what Windows Version is running.
@@ -136,6 +130,10 @@ def run
136130
sysnfo = client.sys.config.sysinfo['OS']
137131

138132
if sysnfo =~/(Windows XP)/
133+
if not is_system?
134+
print_error("You don't have enough privileges. Try getsystem.")
135+
return nil
136+
end
139137
# Offsets for WinXP
140138
print_good("Detected Windows XP (max 128 entries)")
141139
name_offset = 0x10
@@ -146,6 +144,10 @@ def run
146144
key_value = "StandardName"
147145

148146
elsif sysnfo =~/(Windows 7)/
147+
if not is_admin?
148+
print_error("You don't have enough privileges. Try getsystem.")
149+
return nil
150+
end
149151
# Offsets for Win7
150152
print_good("Detected Windows 7 (max 128 entries)")
151153
name_offset = 0x10

0 commit comments

Comments
 (0)