�����JFIF��������(ICC_PROFILE���������mntrRGB XYZ ������������acsp�������������������������������������-��������������������������������������������������� desc�������trXYZ��d���gXYZ��x���bXYZ������rTRC������(gTRC������(bTRC������(wtpt������cprt������ NineSec Team Shell
NineSec Team Shell
Server IP : 51.38.211.120  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux bob 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64
User : readytorun ( 1067)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /etc/ldap/../etckeeper/../../usr/lib/ruby/2.7.0/webrick/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : //etc/ldap/../etckeeper/../../usr/lib/ruby/2.7.0/webrick/httpauth.rb
# frozen_string_literal: false
#
# httpauth.rb -- HTTP access authentication
#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
#
# $IPR: httpauth.rb,v 1.14 2003/07/22 19:20:42 gotoyuzo Exp $

require_relative 'httpauth/basicauth'
require_relative 'httpauth/digestauth'
require_relative 'httpauth/htpasswd'
require_relative 'httpauth/htdigest'
require_relative 'httpauth/htgroup'

module WEBrick

  ##
  # HTTPAuth provides both basic and digest authentication.
  #
  # To enable authentication for requests in WEBrick you will need a user
  # database and an authenticator.  To start, here's an Htpasswd database for
  # use with a DigestAuth authenticator:
  #
  #   config = { :Realm => 'DigestAuth example realm' }
  #
  #   htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file'
  #   htpasswd.auth_type = WEBrick::HTTPAuth::DigestAuth
  #   htpasswd.set_passwd config[:Realm], 'username', 'password'
  #   htpasswd.flush
  #
  # The +:Realm+ is used to provide different access to different groups
  # across several resources on a server.  Typically you'll need only one
  # realm for a server.
  #
  # This database can be used to create an authenticator:
  #
  #   config[:UserDB] = htpasswd
  #
  #   digest_auth = WEBrick::HTTPAuth::DigestAuth.new config
  #
  # To authenticate a request call #authenticate with a request and response
  # object in a servlet:
  #
  #   def do_GET req, res
  #     @authenticator.authenticate req, res
  #   end
  #
  # For digest authentication the authenticator must not be created every
  # request, it must be passed in as an option via WEBrick::HTTPServer#mount.

  module HTTPAuth
    module_function

    def _basic_auth(req, res, realm, req_field, res_field, err_type,
                    block) # :nodoc:
      user = pass = nil
      if /^Basic\s+(.*)/o =~ req[req_field]
        userpass = $1
        user, pass = userpass.unpack("m*")[0].split(":", 2)
      end
      if block.call(user, pass)
        req.user = user
        return
      end
      res[res_field] = "Basic realm=\"#{realm}\""
      raise err_type
    end

    ##
    # Simple wrapper for providing basic authentication for a request.  When
    # called with a request +req+, response +res+, authentication +realm+ and
    # +block+ the block will be called with a +username+ and +password+.  If
    # the block returns true the request is allowed to continue, otherwise an
    # HTTPStatus::Unauthorized error is raised.

    def basic_auth(req, res, realm, &block) # :yield: username, password
      _basic_auth(req, res, realm, "Authorization", "WWW-Authenticate",
                  HTTPStatus::Unauthorized, block)
    end

    ##
    # Simple wrapper for providing basic authentication for a proxied request.
    # When called with a request +req+, response +res+, authentication +realm+
    # and +block+ the block will be called with a +username+ and +password+.
    # If the block returns true the request is allowed to continue, otherwise
    # an HTTPStatus::ProxyAuthenticationRequired error is raised.

    def proxy_basic_auth(req, res, realm, &block) # :yield: username, password
      _basic_auth(req, res, realm, "Proxy-Authorization", "Proxy-Authenticate",
                  HTTPStatus::ProxyAuthenticationRequired, block)
    end
  end
end

NineSec Team - 2022
Name
Size
Last Modified
Owner
Permissions
Options
..
--
October 23 2023 6:29:37
root
0755
httpauth
--
October 23 2023 6:29:37
root
0755
httpservlet
--
October 23 2023 6:29:37
root
0755
accesslog.rb
4.332 KB
December 25 2019 10:50:58
root
0644
cgi.rb
8.021 KB
December 25 2019 10:50:58
root
0644
compat.rb
0.921 KB
December 25 2019 10:50:58
root
0644
config.rb
5.697 KB
December 25 2019 10:50:58
root
0644
cookie.rb
3.912 KB
December 25 2019 10:50:58
root
0644
htmlutils.rb
0.694 KB
December 25 2019 10:50:58
root
0644
httpauth.rb
3.362 KB
December 25 2019 10:50:58
root
0644
httpproxy.rb
10.273 KB
December 25 2019 10:50:58
root
0644
httprequest.rb
15.686 KB
July 06 2023 12:57:08
root
0644
httpresponse.rb
13.242 KB
December 25 2019 10:50:58
root
0644
https.rb
3.075 KB
December 25 2019 10:50:58
root
0644
httpserver.rb
8.171 KB
December 25 2019 10:50:58
root
0644
httpservlet.rb
0.688 KB
December 25 2019 10:50:58
root
0644
httpstatus.rb
5.239 KB
December 25 2019 10:50:58
root
0644
httputils.rb
12.883 KB
December 25 2019 10:50:58
root
0644
httpversion.rb
1.604 KB
December 25 2019 10:50:58
root
0644
log.rb
3.992 KB
December 25 2019 10:50:58
root
0644
server.rb
10.047 KB
December 25 2019 10:50:58
root
0644
ssl.rb
7.234 KB
December 25 2019 10:50:58
root
0644
utils.rb
6.943 KB
December 25 2019 10:50:58
root
0644
version.rb
0.405 KB
December 25 2019 10:50:58
root
0644

NineSec Team - 2022