Skip to content

Commit

Permalink
Add safe navigation to shell read response
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanusz-r7 committed Nov 5, 2024
1 parent 145ab02 commit c7875b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/msf/core/session/provider/single_command_shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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&.include?(cmd)
end

def shell_command_token_win32(cmd, timeout=10)
Expand Down

0 comments on commit c7875b7

Please sign in to comment.