CasperSecurity

Current Path : /lib/python3/dist-packages/twisted/conch/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/twisted/conch/__pycache__/manhole_ssh.cpython-310.pyc

o

�bK�@s�dZddlmZddlmZddlmZmZm	Z
ddlmZddl
mZmZddlmZGdd	�d	�ZGd
d�d�Zee
j�Gdd
�d
ej��ZGdd�dejej�ZGdd�d�ZGdd�dej�ZdS)z9
insults/SSH integration support.

@author: Jp Calderone
�)�Dict)�implementer)�avatar�error�
interfaces)�insults)�factory�session)�
componentsc@s eZdZdZdd�Zdd�ZdS)�_Gluez�
    A feeble class for making one attribute look like another.

    This should be replaced with a real class at some point, probably.
    Try not to write new code that uses it.
    cKs|j�|�dS�N)�__dict__�update)�self�kw�r�;/usr/lib/python3/dist-packages/twisted/conch/manhole_ssh.py�__init__sz_Glue.__init__cCst|jd|��)Nzhas no attribute)�AttributeError�name)rrrrr�__getattr__ �z_Glue.__getattr__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrsrc@�eZdZdd�ZdS)�TerminalSessionTransportcsx|�_��_|�_�jj��j�t�jj��fdd�dd���fdd�}�j�t�jj|dd���jj�	||�dS)Ncs�j���Sr)�conn�	sendCloser)r�protoSessionrr�<lambda>/sz3TerminalSessionTransport.__init__.<locals>.<lambda>zSSH Proto Transport)�write�loseConnectionrcs�j��dSr)�protor#r�rrrr#4rz9TerminalSessionTransport.__init__.<locals>.loseConnectionzChained Proto Transport)
r$r�chainedProtocolr	�makeConnectionr�dataReceivedr"�terminalProtocol�terminalSize)rr$r&r�width�heightr#r)rr rrr%s(����z!TerminalSessionTransport.__init__N�rrrrrrrrr$�rc@sFeZdZeZejZdd�Zdd�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
S)�TerminalSessioncCs|dd�\|_|_dS)N�)r,r+)r�term�
windowSize�attrsrrr�getPtyMszTerminalSession.getPtycCs&|�||��t�|j�|j|j�dSr)�transportFactory�chainedProtocolFactory�iconch�
IConchUser�originalr+r,)rr$rrr�	openShellPs
�zTerminalSession.openShellcCs
t�d��)NzCannot execute commands)�econch�
ConchError)rr$�cmdrrr�execCommandY�
zTerminalSession.execCommandcC�td��)Nz,Unimplemented: TerminalSession.windowChanged��NotImplementedError)r�
newWindowSizerrr�
windowChanged\�zTerminalSession.windowChangedcCr@)Nz*Unimplemented: TerminalSession.eofReceivedrAr%rrr�eofReceived`rEzTerminalSession.eofReceivedcC�dSrrr%rrr�closeddszTerminalSession.closedN)rrrrr5r�ServerProtocolr6r4r:r>rDrFrHrrrrr/Hs	r/c@r)�TerminalUsercCs*tj�||�tj�|�tj|jd<dS)Nssession)r
�Adapterrr�	ConchUserr	�
SSHSession�
channelLookup)rr9�avatarIdrrrrjszTerminalUser.__init__Nr-rrrrrJir.rJc@s8eZdZeZeZeZe	j
Zdd�Zddd�Z
dd�ZdS)	�
TerminalRealmcCsNt��}|�||�}|�|�}|j|_|j|_|�tj|�|�tj	|�|Sr)
r
�
Componentized�userFactory�sessionFactoryr5r6�setComponentr7r8�ISession)rrO�comp�user�sessrrr�
_getAvatarws
zTerminalRealm._getAvatarNcCs|dur	||_dSdSr)r5)rr5rrrr�s
�zTerminalRealm.__init__cGs4|D]}|tjurtj|�|�dd�fSqt��)NcSrGrrrrrrr!�sz-TerminalRealm.requestAvatar.<locals>.<lambda>)r7r8rYrB)rrO�mindr�irrr�
requestAvatar�s

�zTerminalRealm.requestAvatarr)rrrrJrRr/rSrr5rrIr6rYrr\rrrrrPps

rPc@s>eZdZUiZeeefed<iZeeefed<dd�ZdS)�ConchFactory�
publicKeys�privateKeyscCs
||_dSr)�portal)rr`rrrr�r?zConchFactory.__init__N)	rrrr^r�bytes�__annotations__r_rrrrrr]�s
r]N)r�typingr�zope.interfacer�
twisted.conchrrr;rr7�twisted.conch.insultsr�twisted.conch.sshrr	�twisted.pythonr
rrrUrKr/rLrJrP�
SSHFactoryr]rrrr�<module>s$ 
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY