Rescue an IOError on channel double-close.

This was causing output from python meterpreter
commands run on OSX to be discarded when the error
was raised, making cmd_exec not-so-useful.
bug/bundler_fix
Joe Vennix 2014-10-01 22:35:41 -05:00
parent 0380c5e887
commit b1b8cba4c5
No known key found for this signature in database
GPG Key ID: 127B05FB3E85A2B0
1 changed files with 7 additions and 1 deletions

View File

@ -111,7 +111,13 @@ module Msf::Post::Common
o << d
end
o.chomp! if o
process.channel.close
begin
process.channel.close
rescue IOError => e
# Channel was already closed, but we got the cmd output, so let's soldier on.
end
process.close
when /shell/
o = session.shell_command_token("#{cmd} #{args}", time_out)