unbreak cmd shell sessions
git-svn-id: file:///home/svn/framework3/trunk@8285 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
b783052af3
commit
c97798e11a
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue