From 98db8b5ad988fb80b52ccc092270127bddda5baa Mon Sep 17 00:00:00 2001 From: Jon Hart Date: Mon, 17 Nov 2014 09:10:03 -0800 Subject: [PATCH] When not a meterpreter session, split dir/ls output to match meterpreter entries output --- lib/msf/core/post/file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/post/file.rb b/lib/msf/core/post/file.rb index 4596c8df66..3bfd2e98b0 100644 --- a/lib/msf/core/post/file.rb +++ b/lib/msf/core/post/file.rb @@ -36,9 +36,9 @@ module Msf::Post::File return session.fs.dir.entries(where) else if session.platform =~ /win/ - return session.shell_command_token("dir #{where}") + return session.shell_command_token("dir #{where}").split(/[\r\n]+/) else - return session.shell_command_token("ls #{where}") + return session.shell_command_token("ls #{where}").split(/[\r\n]+/) end end end