Refactor pgpass_creds creds

bug/bundler_fix
William Vu 2014-06-12 13:08:47 -05:00
parent 2c007846e4
commit 512395395b
No known key found for this signature in database
GPG Key ID: E761DCB4C1629024
1 changed files with 23 additions and 12 deletions

View File

@ -99,19 +99,30 @@ class Metasploit3 < Msf::Post
pass = p pass = p
cred_table << [ip, port, db, user, pass] cred_table << [ip, port, db, user, pass]
cred_hash = { service_data = {
:host => session.session_host, address: Rex::Socket.getaddress(session.session_host),
:port => port, port: port,
:user => user, protocol: "tcp",
:pass => pass, service_name: "postgres",
:ptype => "password", workspace_id: myworkspace_id
:sname => "postgres",
:source_type => "Cred",
:duplicate_ok => true,
:active => true
} }
report_auth_info(cred_hash) credential_data = {
origin_type: :session,
session_id: session_db_id,
post_reference_name: self.refname,
username: user,
private_data: pass,
private_type: :password
}
credential_core = create_credential(credential_data.merge(service_data))
login_data = {
core: credential_core,
access_level: "User",
status: Metasploit::Credential::Login::Status::UNTRIED
}
end end
if not cred_table.rows.empty? if not cred_table.rows.empty?