modules/auxiliary/scanner/http/glassfish_login.rb
def is_password_required?(version)
    success = false

    if version =~ /^[29]\.x$/
      res = send_request_cgi({'uri'=>'/applications/upload.jsf'})
      set_jsession(res)
      p = /<title>Deploy Enterprise Applications\/Modules/
      if (res && res.code.to_i == 200 && res.body.match(p) != nil)
        success = true
      end
    elsif version =~ /^3\./
      res = send_request_cgi({'uri'=>'/common/applications/uploadFrame.jsf'})
      set_jsession(res)
      p = /<title>Deploy Applications or Modules/
      if (res && res.code.to_i == 200 && res.body.match(p) != nil)
        success = true
      end
    end

    success
  end
#
# For a while, older versions of Glassfish didn't need to set a password for admin,
# but looks like no longer the case anymore, which means this method is getting useless
# (last tested: Aug 2014)
#
For a while, older versions of Glassfish didn't need to set a password for admin,
but looks like no longer the case anymore, which means this method is getting useless
(last tested: Aug 2014)
For a while older versions of Glassfish didn ' t need to set a password for admin but looks like no longer the case anymore which means this method is getting useless ( last tested : Aug 2014 )
def is_password_required?(version)
    success = false
    if version =~ /^[29]\.x$/
      res = send_request_cgi({'uri'=>'/applications/upload.jsf'})
      set_jsession(res)
      p = /<title>Deploy Enterprise Applications\/Modules/
      if (res && res.code.to_i == 200 && res.body.match(p) != nil)
        success = true
      end
    elsif version =~ /^3\./
      res = send_request_cgi({'uri'=>'/common/applications/uploadFrame.jsf'})
      set_jsession(res)
      p = /<title>Deploy Applications or Modules/
      if (res && res.code.to_i == 200 && res.body.match(p) != nil)
        success = true
      end
    end
    success
  end
def is_password_required? ( version ) success = false if version =~ / ^[29] \. x$ / res = send_request_cgi ( { 'uri' => '/applications/upload.jsf' } ) set_jsession ( res ) p = / <title>Deploy Enterprise Applications \/ Modules / if ( res && res . code . to_i == 200 && res . body . match ( p ) != nil ) success = true end elsif version =~ / ^3 \. / res = send_request_cgi ( { 'uri' => '/common/applications/uploadFrame.jsf' } ) set_jsession ( res ) p = / <title>Deploy Applications or Modules / if ( res && res . code . to_i == 200 && res . body . match ( p ) != nil ) success = true end end success end
For a while, older versions of Glassfish didn't need to set a password for admin,
but looks like no longer the case anymore, which means this method is getting useless
(last tested: Aug 2014)
For a while older versions of Glassfish didn ' t need to set a password for admin but looks like no longer the case anymore which means this method is getting useless ( last tested : Aug 2014 )
version