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