Refactor bulletproof_ftp creds

bug/bundler_fix
William Vu 2014-06-11 13:04:58 -05:00
parent 943a4285e4
commit ac94f8e861
No known key found for this signature in database
GPG Key ID: E761DCB4C1629024
1 changed files with 26 additions and 17 deletions

View File

@ -182,12 +182,6 @@ class Metasploit3 < Msf::Post
def report_findings(entries) def report_findings(entries)
if session.db_record
source_id = session.db_record.id
else
source_id = nil
end
entries.each{ |entry| entries.each{ |entry|
@credentials << [ @credentials << [
entry[:site_name], entry[:site_name],
@ -199,17 +193,32 @@ class Metasploit3 < Msf::Post
entry[:local_dir] entry[:local_dir]
] ]
report_auth_info( service_data = {
:host => entry[:site_address], address: Rex::Socket.getaddress(entry[:site_address]),
:port => entry[:port], port: entry[:port],
:proto => 'tcp', protocol: "tcp",
:sname => 'ftp', service_name: "ftp",
:user => entry[:login], workspace_id: myworkspace_id
:pass => entry[:password], }
:ptype => 'password',
:source_id => source_id, credential_data = {
:source_type => "exploit" origin_type: :session,
) session_id: session_db_id,
post_reference_name: self.refname,
username: entry[:login],
private_data: entry[:password],
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
}
create_credential_login(login_data.merge(service_data))
} }
end end