diff --git a/lib/msf/core/session/provider/single_command_shell.rb b/lib/msf/core/session/provider/single_command_shell.rb index 9781f8a10fc0..3decd0003d75 100644 --- a/lib/msf/core/session/provider/single_command_shell.rb +++ b/lib/msf/core/session/provider/single_command_shell.rb @@ -119,7 +119,7 @@ def set_is_echo_shell(timeout, command_separator) cmd = "echo #{numeric_token}" shell_write(cmd + "#{command_separator}echo #{token}#{command_termination}") res = shell_read_until_token(token, 0, timeout) - @is_echo_shell = res.include?(cmd) + @is_echo_shell = res ? res.include?(cmd) : false end def shell_command_token_win32(cmd, timeout=10)