Refactor ftpnavigator creds
parent
943a4285e4
commit
7147a88968
|
@ -67,20 +67,32 @@ class Metasploit3 < Msf::Post
|
||||||
end
|
end
|
||||||
|
|
||||||
print_good("Host: #{server} Port: #{port} User: #{username} Pass: #{dpass}")
|
print_good("Host: #{server} Port: #{port} User: #{username} Pass: #{dpass}")
|
||||||
if session.db_record
|
service_data = {
|
||||||
source_id = session.db_record.id
|
address: Rex::Socket.getaddress(server),
|
||||||
else
|
port: port,
|
||||||
source_id = nil
|
protocol: "tcp",
|
||||||
end
|
service_name: "ftp",
|
||||||
report_auth_info(
|
workspace_id: myworkspace_id
|
||||||
:host => server,
|
}
|
||||||
:port => port,
|
|
||||||
:sname => 'ftp',
|
credential_data = {
|
||||||
:source_id => source_id,
|
origin_type: :session,
|
||||||
:source_type => "exploit",
|
session_id: session_db_id,
|
||||||
:user => username,
|
post_reference_name: self.refname,
|
||||||
:pass => dpass
|
username: username,
|
||||||
)
|
private_data: dpass,
|
||||||
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue