Land #10638, Warn when listing inactive sessions without DB connection

Replaces confusing message and stack trace with a warning message,
when the `sessions -d` command is used to list inactive sessions
when no database is connected.
4.x
Brendan Coles 2018-09-15 05:36:37 +00:00 committed by Metasploit
parent 3ff9b3b0c9
commit 057228c60b
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
2 changed files with 10 additions and 4 deletions

View File

@ -612,10 +612,12 @@ class ReadableText
'Indent' => indent,
'SortIndex' => 1)
framework.db.sessions.each do |session|
unless session.closed_at.nil?
row = create_mdm_session_row(session, show_extended)
tbl << row
if framework.db.active
framework.db.sessions.each do |session|
unless session.closed_at.nil?
row = create_mdm_session_row(session, show_extended)
tbl << row
end
end
end

View File

@ -1205,6 +1205,10 @@ class Core
end
end
if show_inactive && !framework.db.active
print_warning("Database not connected; list of inactive sessions unavailable")
end
last_known_timeout = nil
# Now, perform the actual method