+
    üÐjl  ã                   ó  € R t ^ RIHt ^ RIHtHt ^ RIHtHtH	t	 ^ RI
Ht ^ RIHt ^ RIHtHt ^ RIHt ^ RIHtHt  ! R	 R
4      t ! R R4      t]! ]P0                  4       ! R R4      4       t ! R R]P4                  4      tR tR# )z\
TAP plugin for creating telnet- and ssh-accessible manhole servers.

@author: Jp Calderone
)Úimplementer)ÚserviceÚstrports)ÚmanholeÚmanhole_sshÚtelnet)Úinsults)Úkeys)ÚcheckersÚportal)Úprotocol)ÚfilepathÚusagec                   ó,   a € ] tR t^t o R tR tRtV tR# )ÚmakeTelnetProtocolc                ó   € Wn         R # ©N©r   )Úselfr   s   &&Ú;/usr/lib/python3/dist-packages/twisted/conch/manhole_tap.pyÚ__init__ÚmakeTelnetProtocol.__init__   s   € ØŽó    c                ól   € \         P                  pV P                  3p\         P                  ! V.VO5!  # r   )r   ÚAuthenticatingTelnetProtocolr   ÚTelnetTransport)r   ÚauthÚargss   &  r   Ú__call__ÚmakeTelnetProtocol.__call__   s.   € Ü×2Ñ2ˆØ—‘ˆ~ˆÜ×%Ò% dÐ2¨TÓ2Ð2r   r   N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s   ø‡ € ò÷3ð 3r   r   c                   ó,   a € ] tR t^t o R tR tRtV tR# )ÚchainedProtocolFactoryc                ó   € Wn         R # r   ©Ú	namespace)r   r-   s   &&r   r   ÚchainedProtocolFactory.__init__    s   € Ø"Žr   c                ó`   € \         P                  ! \        P                  V P                  4      # r   )r   ÚServerProtocolr   ÚColoredManholer-   ©r   s   &r   r   ÚchainedProtocolFactory.__call__#   s   € Ü×%Ò%¤g×&<Ñ&<¸d¿n¹nÓMÐMr   r,   Nr    r'   s   @r   r*   r*      s   ø‡ € ò#÷Nð Nr   r*   c                   ó,   a € ] tR t^'t o R tR tRtV tR# )Ú_StupidRealmc                ó*   € Wn         W n        W0n        R # r   )ÚprotocolFactoryÚprotocolArgsÚprotocolKwArgs)r   ÚprotoÚaÚkws   &&*,r   r   Ú_StupidRealm.__init__)   s   € Ø$ÔØÔØ Ör   c                ó°   € \         P                  V9   d9   \         P                  V P                  ! V P                  / V P                  B R  3# \        4       h)c                  ó   € R # r   © r@   r   r   Ú<lambda>Ú,_StupidRealm.requestAvatar.<locals>.<lambda>3   s   € ™r   )r   ÚITelnetProtocolr7   r8   r9   ÚNotImplementedError)r   ÚavatarIdÚ
interfacess   &&*r   ÚrequestAvatarÚ_StupidRealm.requestAvatar.   sP   € Ü×!Ñ! ZÔ/ä×&Ñ&Ø×$Ò$ d×&7Ñ&7ÐO¸4×;NÑ;NÑOÙðð ô
 "Ó#Ð#r   )r8   r7   r9   N)r!   r"   r#   r$   r   rG   r%   r&   r'   s   @r   r5   r5   '   s   ø‡ € ò!÷
$ð $r   r5   c                   óT   a € ] tR t^8t o . RO. RO. RO. RO. R	O. R
O.tR tR tRtV tR# )ÚOptionsNc                óN   € \         P                  P                  V 4       R V R&   R # )Nr-   )r   rJ   r   r2   s   &r   r   ÚOptions.__init__\   s   € Ü�‰×Ñ˜tÔ$Ø ˆˆ[Ór   c                ób   € V R ,          f$   V R,          f   \         P                  ! R4      hR# R# )Ú
telnetPortNÚsshPortz<At least one of --telnetPort and --sshPort must be specified)r   Ú
UsageErrorr2   s   &r   ÚpostOptionsÚOptions.postOptions`   s5   € Ø�ÕÒ%¨$¨y­/Ò*AÜ×"Ò"ØNóð ñ +BÑ%r   r@   )rN   ÚtNzMstrports description of the address on which to listen for telnet connections)rO   ÚsNzJstrports description of the address on which to listen for ssh connections)ÚpasswdÚpz/etc/passwdz1name of a passwd(5)-format username/password file)Ú	sshKeyDirNú<USER DATA DIR>z2Directory where the autogenerated SSH key is kept.)Ú
sshKeyNameNz
server.keyz&Filename of the autogenerated SSH key.)Ú
sshKeySizeNi   z,Size of the automatically generated SSH key.)	r!   r"   r#   r$   ÚoptParametersr   rQ   r%   r&   r'   s   @r   rJ   rJ   8   s:   ø‡ € ò	
ò	
ò	
ò	
ò 	UÚRðA!€MòF!÷ð r   rJ   c                ó6  € \         P                  ! 4       pV R,          pVf   / p\        P                  ! V R,          4      pV R,          '       d¤   \	        \
        P                  \        P                  \        P                  V4      p\        P                  ! WC.4      p\        P                  ! 4       p\        V4      Vn        \         P                   ! V R,          V4      pVP#                  V4       V R,          '       Ed   \$        P&                  ! 4       p\)        V4      Vn        \        P                  ! Wƒ.4      p	\$        P*                  ! V	4      p
V R,          R8w  d   V R,          pM^ RIHp V! 4       p\0        P2                  ! V4      P5                  V R,          4      p\6        P8                  ! V\;        V R	,          4      4      pWêP<                  R
&   WêP>                  R
&   \         P                   ! V R,          V
4      pVP#                  V4       V# )aë  
Create a manhole server service.

@type options: L{dict}
@param options: A mapping describing the configuration of
the desired service.  Recognized key/value pairs are::

    "telnetPort": strports description of the address on which
                  to listen for telnet connections.  If None,
                  no telnet service will be started.

    "sshPort": strports description of the address on which to
               listen for ssh connections.  If None, no ssh
               service will be started.

    "namespace": dictionary containing desired initial locals
                 for manhole connections.  If None, an empty
                 dictionary will be used.

    "passwd": Name of a passwd(5)-format username/password file.

    "sshKeyDir": The folder that the SSH server key will be kept in.

    "sshKeyName": The filename of the key.

    "sshKeySize": The size of the key, in bits. Default is 4096.

@rtype: L{twisted.application.service.IService}
@return: A manhole service.
r-   rU   rN   rO   rW   rX   )ÚgetDataDirectoryrY   rZ   s   ssh-rsa) r   ÚMultiServicer
   ÚFilePasswordDBr5   r   ÚTelnetBootstrapProtocolr   r0   r   r1   r   ÚPortalr   ÚServerFactoryr   r   ÚsetServiceParentr   ÚTerminalRealmr*   ÚConchFactoryÚtwisted.python._appdirsr]   r   ÚFilePathÚchildr	   Ú_getPersistentRSAKeyÚintÚ
publicKeysÚprivateKeys)ÚoptionsÚsvcr-   ÚcheckerÚtelnetRealmÚtelnetPortalÚtelnetFactoryÚtelnetServiceÚsshRealmÚ	sshPortalÚ
sshFactoryÚkeyDirr]   ÚkeyLocationÚsshKeyÚ
sshServices   &               r   ÚmakeServicer{   g   s¬  € ô> ×
Ò
Ó
 €Cà˜Õ$€IØÒØˆ	ä×%Ò% g¨hÕ&7Ó8€Gàˆ|×ÔÜ"Ü×*Ñ*Ü×"Ñ"Ü×"Ñ"Øó	
ˆô —}’} [°)Ó<ˆä ×.Ò.Ó0ˆÜ!3°LÓ!AˆÔÜ ×(Ò(¨°Õ)>ÀÓNˆØ×&Ñ& sÔ+àˆy×ÕÜ×,Ò,Ó.ˆÜ*@ÀÓ*KˆÔ'ä—M’M (¨IÓ6ˆ	Ü ×-Ò-¨iÓ8ˆ
à�;ÕÐ#4Ô4Ø˜[Õ)‰Få@á%Ó'ˆFä×'Ò'¨Ó/×5Ñ5°g¸lÕ6KÓLˆä×*Ò*¨;¼¸GÀLÕ<QÓ8RÓSˆØ,2×Ñ˜jÑ)Ø-3×Ñ˜zÑ*ä×%Ò% g¨iÕ&8¸*ÓEˆ
Ø×#Ñ# CÔ(à€Jr   N)Ú__doc__Úzope.interfacer   Útwisted.applicationr   r   Útwisted.conchr   r   r   Útwisted.conch.insultsr   Útwisted.conch.sshr	   Útwisted.credr
   r   Útwisted.internetr   Útwisted.pythonr   r   r   r*   ÚIRealmr5   rJ   r{   r@   r   r   Ú<module>r†      sv   ðñõ 'ç 1ß 6Ñ 6Ý )Ý "ß )Ý %ß *÷3ñ 3÷Nñ Nñ ˆV�]‰]Ó÷$ð $ó ð$ô ,ˆe�m‰mô ,ô^Mr   