From b5f4b72b511e97a8be625a109d776a7f0d2a4a23 Mon Sep 17 00:00:00 2001 From: rwhitcroft Date: Fri, 10 Apr 2015 00:28:35 -0400 Subject: [PATCH 1/2] fix timestomp arg parsing --- .../ui/console/command_dispatcher/priv/timestomp.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb index b5441755b3..4f03027552 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb @@ -52,12 +52,21 @@ class Console::CommandDispatcher::Priv::Timestomp # def cmd_timestomp(*args) if (args.length < 2) - print_line("\nUsage: timestomp file_path OPTIONS\n" + + print_line("\nUsage: timestomp OPTIONS file_path\n" + @@timestomp_opts.usage) return end - file_path = args.shift + file_path = nil + args.each { |a| file_path = a unless a[0] == "-" } + + if file_path.nil? + print_line("\nNo filepath specified.") + return + end + + args.delete(file_path) + modified = nil accessed = nil creation = nil From 8acc768da7825629aba9338c4b3f63072cd4b258 Mon Sep 17 00:00:00 2001 From: William Vu Date: Fri, 10 Apr 2015 17:17:54 -0500 Subject: [PATCH 2/2] Copy documentation --- .../meterpreter/ui/console/command_dispatcher/priv/timestomp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb index 4f03027552..8d7ba38af4 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb @@ -61,7 +61,7 @@ class Console::CommandDispatcher::Priv::Timestomp args.each { |a| file_path = a unless a[0] == "-" } if file_path.nil? - print_line("\nNo filepath specified.") + print_line("\nNo file_path specified.") return end