Method: Metasploit::Framework::LoginScanner::WordpressMulticall#attempt_login
- Defined in:
- lib/metasploit/framework/login_scanner/wordpress_multicall.rb
#attempt_login(credential) ⇒ Metasploit::Framework::LoginScanner::Result
Attempts to login.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/metasploit/framework/login_scanner/wordpress_multicall.rb', line 109 def attempt_login(credential) set_default @passwords ||= [credential.private] generate_xml(credential.public).each do |xml| send_wp_request(xml) req_xml = Nokogiri::Slop(xml) res_xml = Nokogiri::Slop(@res.to_s.scan(/<.*>/).join) res_xml.search("methodResponse/params/param/value/array/data/value").each_with_index do |value, i| result = value.at("struct/member/value/int") if result.nil? pass = req_xml.search("data/value/array/data")[i].value[1].text.strip credential.private = pass result_opts = { credential: credential, host: host, port: port, protocol: 'tcp' } result_opts.merge!(status: Metasploit::Model::Login::Status::SUCCESSFUL) return Result.new(result_opts) end end end result_opts = { credential: credential, host: host, port: port, protocol: 'tcp' } result_opts.merge!(status: Metasploit::Model::Login::Status::INCORRECT) return Result.new(result_opts) end |