lib/metasploit/framework/login_scanner/glassfish.rb
def try_glassfish_2(credential)
          res = try_login(credential)
          if res && res.code == 302
            opts = {
              'uri'     => '/applications/upload.jsf',
              'method'  => 'GET',
              'headers' => {
                'Cookie'  => "JSESSIONID=#{self.jsession}"
              }
            }
            res = send_request(opts)
            p = /<title>Deploy Enterprise Applications\/Modules/
            if (res && res.code.to_i == 200 && res.body.match(p) != nil)
              return {:status => Metasploit::Model::Login::Status::SUCCESSFUL, :proof => res.body}
            end
          end

          {:status => Metasploit::Model::Login::Status::INCORRECT, :proof => res.body}
        end
# Tries to login to Glassfish version 2
#
# @param credential [Metasploit::Framework::Credential] The credential object
# @return [Hash]
#   * :status [Metasploit::Model::Login::Status]
#   * :proof [String] the HTTP response body
Tries to login to Glassfish version 2
Tries to login to Glassfish version 2
def try_glassfish_2(credential)
          res = try_login(credential)
          if res && res.code == 302
            opts = {
              'uri'     => '/applications/upload.jsf',
              'method'  => 'GET',
              'headers' => {
                'Cookie'  => "JSESSIONID=#{self.jsession}"
              }
            }
            res = send_request(opts)
            p = /<title>Deploy Enterprise Applications\/Modules/
            if (res && res.code.to_i == 200 && res.body.match(p) != nil)
              return {:status => Metasploit::Model::Login::Status::SUCCESSFUL, :proof => res.body}
            end
          end
          {:status => Metasploit::Model::Login::Status::INCORRECT, :proof => res.body}
        end
def try_glassfish_2 ( credential ) res = try_login ( credential ) if res && res . code == 302 opts = { 'uri' => '/applications/upload.jsf' , 'method' => 'GET' , 'headers' => { 'Cookie' => "JSESSIONID=#{self.jsession}" } } res = send_request ( opts ) p = / <title>Deploy Enterprise Applications \/ Modules / if ( res && res . code . to_i == 200 && res . body . match ( p ) != nil ) return { :status => Metasploit :: Model :: Login :: Status :: SUCCESSFUL , :proof => res . body } end end { :status => Metasploit :: Model :: Login :: Status :: INCORRECT , :proof => res . body } end
Tries to login to Glassfish version 2
Tries to login to Glassfish version 2
:status [Metasploit::Model::Login::Status] * :proof [String] the HTTP response body
: status [ Metasploit :: Model :: Login :: Status ] * : proof [ String ] the HTTP response body
Hash
credential
The credential object
The credential object