Enable running scripts independent of console state. Fixes issue with running scripts from GUI while shell/channel is active.

git-svn-id: file:///home/svn/framework3/trunk@10872 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Weeks 2010-11-02 23:33:22 +00:00
parent 8e44f66d31
commit 90500eebd1
1 changed files with 8 additions and 1 deletions

View File

@ -145,7 +145,14 @@ class Session < Base
end
def meterpreter_script(token, sid, data)
meterpreter_write(token, sid, ["run #{data}"].pack("m*"))
s = _valid_session(token,sid,"meterpreter")
if not s.user_output.respond_to? :dump_buffer
s.init_ui(Rex::Ui::Text::Input::Buffer.new, Rex::Ui::Text::Output::Buffer.new)
end
Thread.new(s) { |sess| sess.console.run_single("run #{data}") }
{}
end
protected