Support backgrounding/killing active channels in meterpreter sessions; and not just the sessions themselves.

git-svn-id: file:///home/svn/framework3/trunk@10699 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
Matt Weeks 2010-10-15 22:38:06 +00:00
parent 48bcc580b8
commit 4f40459498
1 changed files with 21 additions and 0 deletions

View File

@ -104,12 +104,33 @@ class WebConsole
def session_detach
if(self.console.active_session)
#background interactive meterpreter channel
if(self.console.active_session.channels)
self.console.active_session.channels.each_value do |ch|
if(ch.interacting)
ch.detach()
return
end
end
end
#background session
self.console.active_session.completed = true
self.console.active_session.detach()
end
end
def session_kill
if(self.console.active_session)
#close interactive meterpreter channel
if(self.console.active_session.channels)
self.console.active_session.channels.each_value do |ch|
if(ch.interacting)
ch.close()
return
end
end
end
#kill session
self.console.active_session.kill()
end
end