unbreak cmd shell sessions

git-svn-id: file:///home/svn/framework3/trunk@8285 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2010-01-28 02:17:57 +00:00
parent b783052af3
commit c97798e11a
1 changed files with 9 additions and 15 deletions

View File

@ -233,18 +233,23 @@ class FrameworkEventSubscriber
#report_event(:name => "ui_start", :info => info) #report_event(:name => "ui_start", :info => info)
end end
def session_event(name, session) def session_event(name, session, opts={})
address = session.tunnel_peer[0, session.tunnel_peer.rindex(":")]
if framework.db.active if framework.db.active
event = { event = {
:name => name, :name => name,
:host => session.sock.peerhost, :host => address,
:info => { :info => {
:session_id => session.sid, :session_id => session.sid,
:via_exploit => session.via_exploit :via_exploit => session.via_exploit
} }.merge(opts)
} }
report_event(event) report_event(event)
end end
if session.respond_to? "alive" and not session.alive
framework.sessions.deregister(session)
end
end end
require 'msf/core/session' require 'msf/core/session'
@ -262,18 +267,7 @@ class FrameworkEventSubscriber
end end
def on_session_command(session, command) def on_session_command(session, command)
if framework.db.active session_event('session_interact', session, :command => command)
event = {
:name => 'session_command',
:host => session.sock.peerhost,
:info => {
:session_id => session.sid,
:via_exploit => session.via_exploit,
:command => command
}
}
report_event(event)
end
end end