fix rpc session conditional to allow powershell read/write

This commit is contained in:
Louis Sato 2015-10-28 11:49:32 -05:00
parent a65172bbcb
commit 657a5481dc
No known key found for this signature in database
GPG Key ID: 501290E4CECB7DF4
1 changed files with 4 additions and 2 deletions

View File

@ -481,15 +481,17 @@ private
def _valid_session(sid,type)
s = self.framework.sessions[sid.to_i]
if(not s)
error(500, "Unknown Session ID")
error(500, "Unknown Session ID #{sid}")
end
if type == "ring"
if not s.respond_to?(:ring)
error(500, "Session #{s.type} does not support ring operations")
end
elsif (s.type != type)
elsif (type == 'meterpreter' && s.type != type) ||
(type == 'shell' && s.type == 'meterpreter')
error(500, "Session is not of type " + type)
end
s