Skip to content

Commit 1b01232

Browse files
author
Brent Cook
committed
Land rapid7#9070, Fix bug copying MACE attributes between files
2 parents 402e926 + bdc00ef commit 1b01232

File tree

1 file changed

+7
-6
lines changed
  • lib/rex/post/meterpreter/ui/console/command_dispatcher/priv

1 file changed

+7
-6
lines changed

lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ def cmd_timestomp(*args)
7878
creation = str_to_time(val)
7979
emodified = str_to_time(val)
8080
when "-f"
81-
print_status("Setting MACE attributes on #{path} from #{val}")
82-
hash = client.priv.fs.get_file_mace(path)
81+
print_status("Pulling MACE attributes from #{val}")
82+
hash = client.priv.fs.get_file_mace(val)
8383
if hash
84-
modified = str_to_time(hash['Modified'])
85-
accessed = str_to_time(hash['Accessed'])
86-
creation = str_to_time(hash['Created'])
87-
emodified = str_to_time(hash['Entry Modified'])
84+
modified = hash['Modified']
85+
accessed = hash['Accessed']
86+
creation = hash['Created']
87+
emodified = hash['Entry Modified']
8888
end
8989
when "-b"
9090
blank_file_mace = true
@@ -112,6 +112,7 @@ def cmd_timestomp(*args)
112112
end
113113

114114
paths.uniq.each do |path|
115+
115116
# If any one of the four times were specified, change them.
116117
if modified || accessed || creation || emodified
117118
print_status("Setting specific MACE attributes on #{path}")

0 commit comments

Comments
 (0)