store more specific credential wordpress_directory_traversal_dos
parent
6161fbacb0
commit
d68365d8df
|
@ -66,43 +66,10 @@ class MetasploitModule < Msf::Auxiliary
|
|||
datastore['DEPTH']
|
||||
end
|
||||
|
||||
def report_cred(opts)
|
||||
service_data = {
|
||||
address: opts[:ip],
|
||||
port: opts[:port],
|
||||
service_name: opts[:service_name],
|
||||
protocol: 'tcp',
|
||||
workspace_id: myworkspace_id
|
||||
}
|
||||
|
||||
credential_data = {
|
||||
origin_type: :service,
|
||||
module_fullname: fullname,
|
||||
username: opts[:user]
|
||||
}.merge(service_data)
|
||||
|
||||
login_data = {
|
||||
last_attempted_at: DateTime.now,
|
||||
core: create_credential(credential_data),
|
||||
status: Metasploit::Model::Login::Status::SUCCESSFUL,
|
||||
proof: opts[:proof]
|
||||
}.merge(service_data)
|
||||
|
||||
create_credential_login(login_data)
|
||||
end
|
||||
|
||||
def user_exists(user)
|
||||
exists = wordpress_user_exists?(user)
|
||||
if exists
|
||||
print_good("Username \"#{username}\" is valid")
|
||||
report_cred(
|
||||
ip: rhost,
|
||||
port: rport,
|
||||
user: user,
|
||||
service_name: (ssl ? 'https' : 'http'),
|
||||
proof: "WEBAPP=\"Wordpress\", VHOST=#{vhost}"
|
||||
)
|
||||
|
||||
return true
|
||||
else
|
||||
print_error("\"#{user}\" is not a valid username")
|
||||
|
@ -121,6 +88,7 @@ class MetasploitModule < Msf::Auxiliary
|
|||
starting_thread = 1
|
||||
|
||||
cookie = wordpress_login(username, password)
|
||||
store_valid_credential(user: user, private: password, proof: cookie)
|
||||
if cookie.nil?
|
||||
print_error('Aborting operation - failed to authenticate')
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue