Skip to content

Commit ad8bbf4

Browse files
committed
Rescue rescue Rex::TimeoutError so the iteration can keep going
1 parent a8e3ee0 commit ad8bbf4

File tree

1 file changed

+6
-4
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+6
-4
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,12 +1705,14 @@ def cmd_sessions(*args)
17051705
'Channelized' => true,
17061706
'Hidden' => true
17071707
})
1708+
if process && process.channel
1709+
data = process.channel.read
1710+
print_line(data) if data
1711+
end
17081712
rescue ::Rex::Post::Meterpreter::RequestError
17091713
print_error("Failed: #{$!.class} #{$!}")
1710-
end
1711-
if process && process.channel
1712-
data = process.channel.read
1713-
print_line(data) if data
1714+
rescue Rex::TimeoutError
1715+
print_error("Operation timed out")
17141716
end
17151717
elsif session.type == 'shell'
17161718
output = session.shell_command(cmd)

0 commit comments

Comments
 (0)