refactor smartftp post module

refactor the smartftp credential post module to use
Metasploit::Credential
bug/bundler_fix
David Maloney 2014-06-02 11:48:45 -05:00
parent 34004908bb
commit 9eb42cb80f
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
1 changed files with 28 additions and 8 deletions

View File

@ -109,14 +109,34 @@ class Metasploit3 < Msf::Post
else
source_id = nil
end
report_auth_info(
:host => host,
:port => port,
:source_id => source_id,
:source_type => "exploit",
:user => user,
:pass => pass
)
service_data = {
address: host,
port: port,
service_name: 'ftp',
protocol: 'tcp',
workspace_id: myworkspace_id
}
credential_data = {
origin_type: :session,
session_id: session_db_id,
post_reference_name: self.refname,
private_type: :password,
private_data: pass,
username: user
}
credential_data.merge!(service_data)
credential_core = create_credential(credential_data)
login_data ={
core: credential_core,
status: Metasploit::Credential::Login::Status::UNTRIED
}
login_data.merge!(service_data)
login = create_credential_login(login_data)
end
end