Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/msf/core/rpc/v10/rpc_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ def rpc_invalidate_login(xopts)
# * 'port' [Integer] Port.
# * 'proto' [String] Protocol.
# * 'sname' [String] Service name.
# * 'realm_key' [String] Realm key type.
# * 'realm_value' [String] Realm value.
# @example Here's how you would use this from the client:
# rpc.call('db.creds', {})
def rpc_creds(xopts)
Expand Down Expand Up @@ -298,7 +300,9 @@ def rpc_creds(xopts)
:host => host,
:port => port,
:proto => proto,
:sname => sname
:sname => sname,
:realm_key => cred.realm.try(:key),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your thoughts on:

realm = cred.realm ? { key: cred.realm.key, value: cred.realm.value } : nil

...

ret[:creds] << {
  ...,
  :realm => realm
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach is consistent with the rpc_create_credential method here:

realm_value: core.realm.try(:value),

I can change it though if we'd prefer 👍

:realm_value => cred.realm.try(:value)
}
end
ret
Expand Down
Loading