Skip to content

Commit 2a9f813

Browse files
committed
Don't interpreter blank string as error
1 parent 9f299f4 commit 2a9f813

File tree

1 file changed

+5
-3
lines changed
  • lib/rex/post/meterpreter/ui/console/command_dispatcher

1 file changed

+5
-3
lines changed

lib/rex/post/meterpreter/ui/console/command_dispatcher/powershell.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ def cmd_powershell_import(*args)
105105
}
106106

107107
result = client.powershell.import_file(opts)
108-
if !result.blank? && result != false
109-
print_good("File successfully imported. Result:\n#{result}")
110-
else
108+
if result.nil? || result == false
111109
print_error("File failed to load.")
110+
elsif result.empty?
111+
print_good("File successfully imported. No result was returned.")
112+
else
113+
print_good("File successfully imported. Result:\n#{result}")
112114
end
113115
end
114116

0 commit comments

Comments
 (0)