From d08510596fd3cbfd47cd046da3e30ab58085ae3b Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Tue, 23 Jan 2018 10:46:06 -0600 Subject: [PATCH] Keep reading external messages on stderr eof --- lib/msf/core/modules/external/bridge.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/modules/external/bridge.rb b/lib/msf/core/modules/external/bridge.rb index fbaaa97ed4..baad9dc30d 100644 --- a/lib/msf/core/modules/external/bridge.rb +++ b/lib/msf/core/modules/external/bridge.rb @@ -131,8 +131,9 @@ class Msf::Modules::External::Bridge raise EOFError.new else fds = res[0] - # Preferentially drain and log stderr - if fds.include? err + # Preferentially drain and log stderr, EOF counts as activity, but + # stdout might have some buffered data left, so carry on + if fds.include?(err) && !err.eof? errbuf = err.readpartial(4096) elog "Unexpected output running #{self.path}:\n#{errbuf}" end