Class: Metasploit::Framework::LoginScanner::Axis2

Inherits:
HTTP
  • Object
show all
Defined in:
lib/metasploit/framework/login_scanner/axis2.rb

Overview

Tomcat Manager login scanner

Constant Summary collapse

DEFAULT_PORT =
8080
CAN_GET_SESSION =

Inherit LIKELY_PORTS,LIKELY_SERVICE_NAMES, and REALM_KEY from HTTP

true
PRIVATE_TYPES =
[ :password ]

Constants inherited from HTTP

HTTP::AUTHORIZATION_HEADER, HTTP::DEFAULT_HTTP_NOT_AUTHED_CODES, HTTP::DEFAULT_HTTP_SUCCESS_CODES, HTTP::DEFAULT_REALM, HTTP::DEFAULT_SSL_PORT, HTTP::LIKELY_PORTS, HTTP::LIKELY_SERVICE_NAMES, HTTP::REALM_KEY

Instance Attribute Summary

Attributes inherited from HTTP

#digest_auth_iis, #evade_header_folding, #evade_method_random_case, #evade_method_random_invalid, #evade_method_random_valid, #evade_pad_fake_headers, #evade_pad_fake_headers_count, #evade_pad_get_params, #evade_pad_get_params_count, #evade_pad_method_uri_count, #evade_pad_method_uri_type, #evade_pad_post_params, #evade_pad_post_params_count, #evade_pad_uri_version_count, #evade_pad_uri_version_type, #evade_shuffle_get_params, #evade_shuffle_post_params, #evade_uri_dir_fake_relative, #evade_uri_dir_self_reference, #evade_uri_encode_mode, #evade_uri_fake_end, #evade_uri_fake_params_start, #evade_uri_full_url, #evade_uri_use_backslashes, #evade_version_random_invalid, #evade_version_random_valid, #http_password, #http_success_codes, #http_username, #keep_connection_alive, #kerberos_authenticator_factory, #method, #ntlm_domain, #ntlm_send_lm, #ntlm_send_ntlm, #ntlm_send_spn, #ntlm_use_lm_key, #ntlm_use_ntlmv2, #ntlm_use_ntlmv2_session, #uri, #user_agent, #vhost

Instance Method Summary collapse

Methods inherited from HTTP

#authentication_required?, #build_http_service_opts, #build_service_opts, #db, #send_request, #service_as_result

Methods included from Msf::Auxiliary::Report

#active_db?, #create_cracked_credential, #create_credential, #create_credential_and_login, #create_credential_login, #db, #db_warning_given?, #get_client, #get_host, #inside_workspace_boundary?, #invalidate_login, #mytask, #myworkspace, #myworkspace_id, #report_auth_info, #report_client, #report_exploit, #report_host, #report_loot, #report_note, #report_service, #report_vuln, #report_web_form, #report_web_page, #report_web_site, #report_web_vuln, #store_cred, #store_local, #store_loot

Methods included from Require

optionally, optionally_active_record_railtie, optionally_include_metasploit_credential_creation, #optionally_include_metasploit_credential_creation, optionally_require_metasploit_db_gem_engines

Instance Method Details

#attempt_login(credential) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/metasploit/framework/login_scanner/axis2.rb', line 36

def (credential)
  result_opts = {
      credential: credential,
      **service_as_result(service_opts)
  }

  begin
    # Refactor to access Metasploit::Framework::LoginScanner::HTTP#send_request()
    # to send request to the HTTP server and obtain a response
    response = send_request({
      'uri' => uri,
      'method' => 'POST',
      'vars_post' =>
       {
         'userName' => credential.public,
         'password' => credential.private,
         'submit' => '+Login+'
       }
    })

    if response && response.code == 200 && response.body.include?("upload")
      result_opts.merge!(status: Metasploit::Model::Login::Status::SUCCESSFUL, proof: response)
    else
      result_opts.merge!(status: Metasploit::Model::Login::Status::INCORRECT, proof: response)
    end
  rescue ::EOFError, Rex::ConnectionError, ::Timeout::Error => e
    result_opts.merge!(status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: e)
  end

  Result.new(result_opts)

end

#check_setupfalse, String

Checks if the target is Apache Axis2

Returns:

  • (false)

    if the target looks like Axis2

  • (String)

    a human-readable error message if it doesn’t



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/metasploit/framework/login_scanner/axis2.rb', line 21

def check_setup
  res = send_request({
    'method' => 'GET',
    'uri'    => uri
  })

  return 'Unable to connect to the Axis2 login page' unless res
  return 'Unable to locate Axis2 login page (Is this really Apache Axis2?)' unless res.code == 200 && res.body.include?('axis2-admin')

  report_service(service_opts)

  false
end

#method=(_) ⇒ Object

The method must be “POST”, so don’t let the user change it

Raises:

  • (RuntimeError)


79
80
81
# File 'lib/metasploit/framework/login_scanner/axis2.rb', line 79

def method=(_)
  raise RuntimeError, "Method must be POST for Axis2"
end

#service_optsObject



83
84
85
# File 'lib/metasploit/framework/login_scanner/axis2.rb', line 83

def service_opts
  build_service_opts('axis2')
end

#set_sane_defaultsObject



70
71
72
73
74
75
# File 'lib/metasploit/framework/login_scanner/axis2.rb', line 70

def set_sane_defaults
  self.uri = "/axis2/axis2-admin/login" if self.uri.nil?
  @method = "POST".freeze

  super
end