%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/plesk/python/2.7/lib/python2.7/site-packages/smb/
Upload File :
Create Path :
Current File : //opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pyc

�
�ac@sddlZddlZddlZddlZddlZddlmZy&ddlZejd�d�Z	Wn'e
efk
r�ddlm	Z	nXyddlZd�Z
Wn&e
k
r�ddlZd�Z
nXdZd	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&d Z'd!Z(d"Z)d#Z*d$Z+d%Z,d&Z-d'Z.eeBeBeBe"Be&Be(Be,Be-Be.BZ/d(�Z0d)d*d+�Z1d,�Z2d-dd.�Z4d/�Z5d0�Z6e7dd1�Z8dS(2i����N(tdestmd4cCs
tjd�S(NR(thashlibtnew(((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytMD4	t(RcCs
tj|�S(N(Rtmd5(ts((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytMD5RcCs
tj|�S(N(RR(R((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pyRRiiiiii i@i�iiiiii i@i�iiiiii i@i�iiiiii i@I�cCs%tjdddtddd�}|S(	s>
    References:
    ===========
    - [MS-NLMP]: 2.2.1.1
    s<8sII8s8s8ssNTLMSSPisisrss(tstructtpackt
NTLM_FLAGS(R((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytgenerateNegotiateMessageFs			t	WORKGROUPt	LOCALHOSTcCsjd}tj|�}t|�}	|}
t|�}|
|	}|jd�}
t|
�}||}d}|ddkr�d}|d7}n|jd�}t|�}||}|jd�}t|�}||}t|�}||}|}|tM}tj|dd	|	|	|
||||||||||||||||�}|||||
|||S(
s>
    References:
    ===========
    - [MS-NLMP]: 2.2.1.3
    s<8sIHHIHHIHHIHHIHHIHHIIsUTF-16LERiisisNTLMSSPi(R	tcalcsizetlentencodetNTLM_NegotiateVersionR
(tchallenge_flagstnt_responsetlm_responsetsession_keytusertdomaintworkstationtFORMATtFORMAT_SIZEtlm_response_lengthtlm_response_offsettnt_response_lengthtnt_response_offsettdomain_unicodet
domain_lengtht
domain_offsettpaddingtuser_unicodetuser_lengthtuser_offsettworkstation_unicodetworkstation_lengthtworkstation_offsettsession_key_lengthtsession_key_offsett
auth_flagsR((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytgenerateAuthenticateMessageTsB





								cCs�d}tj|�}tj||| �\}}}}}}}	}
}}}
|dks^t�|dkspt�|	|||
|
|!fS(sa
    References:
    ===========
    - [MS-NLMP]: 2.2.1.2
    - [MS-NLMP]: 2.2.2.1 (AV_PAIR)
    s<8sIHHII8s8sHHIsNTLMSSPi(R	RtunpacktAssertionError(t	ntlm_dataRRt	signaturetmessage_typettargetname_lenttargetname_maxlenttargetname_offsettflagst	challenget_ttargetinfo_lenttargetinfo_maxlenttargetinfo_offset((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytdecodeChallengeMessage�s7RcCs;d	}|sHd}x3tdd�D]}|ttjd��7}q"Wnt|�dks`t�t�}|j|jd��|j	�}	t
j|	|j�|jd��j	�}
dd
||d|}t
j|
||�j	�}||}
t
j|
||�j	�|}t
j|
|�j	�}|
||fS(NsiRisUTF-16LEsiisss(
trangetchrtrandomtgetrandbitsRR/RtupdateRtdigestthmacRtupper(tpasswordRtserver_challengetserver_infoRtclient_challengetclient_timestamptitdt	ntlm_hashtresponse_keyttempt
ntproofstrtnt_challenge_responsetlm_challenge_responseR((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytgenerateChallengeResponseV2�s  	+
 cCs�tt|d�d?d@d>�}|tt|d�d@d>t|d�d?d@Bd>�}|tt|d�d@d>t|d�d?d	@Bd>�}|tt|d�d
@d>t|d�d?d@Bd>�}|tt|d�d@d>t|d�d?d
@Bd>�}|tt|d�d	@d>t|d�d?d@Bd>�}|tt|d�d@d>t|d�d
?d@Bd>�}|tt|d�d@d>�}|S(
s?Expand the key from a 7-byte password key into a 8-byte DES keyiiiiii?iiiiii(R>tord(tkeyR((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytexpandDesKey�s"<<<<<<"cCsvtt|dd!��}tt|dd!��}tt|dd!d��}|j|�|j|�|j|�S(so
    References:
    ===========
    - http://ubiqx.org/cifs/SMB.html (2.8.3.4)
    - [MS-NLMP]: Section 6
    iiiisis(RRUtencrypt(tKtDtd1td2td3((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytDESL�scCsg|j�d
d }tt|d ��}tt|d��}|jd�|jd�}t�}|j|jd��|j�}	|r|s�d}x3tdd�D]}
|t	t
jd��7}q�Wnt|�dks�t
�|d}t|	t||�j�dd!�}nt|	|�}t||�}t�}|j|	�|j�}
|||
fS(s�
    Generate a NTLMv1 response

    @param password: User password string
    @param server_challange: A 8-byte challenge string sent from the server
    @param has_extended_security: A boolean value indicating whether NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY flag is enabled in the NTLM negFlag
    @param client_challenge: A 8-byte string representing client challenge. If None, it will be generated randomly if needed by the response generation
    @return: a tuple of ( NT challenge response string, LM challenge response string )

    References:
    ===========
    - http://ubiqx.org/cifs/SMB.html (2.8.3.3 and 2.8.3.4)
    - [MS-NLMP]: 3.3.1
    siisKGS!@#$%sUTF-16LERiiiss(RDRRURVRRARRBR=R>R?R@RR/R\R(RERFthas_extended_securityRHt	_passwordRYRZtlm_response_keyRKtnt_response_keyRJRQRPR((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pytgenerateChallengeResponseV1�s*	 
)	
(9ttypesRCtbinasciiR	R?tutils.pyDesRRRRtImportErrort
ValueErrort	utils.md4RRtNTLM_NegotiateUnicodetNTLM_NegotiateOEMtNTLM_RequestTargett
NTLM_Unknown9tNTLM_NegotiateSigntNTLM_NegotiateSealtNTLM_NegotiateDatagramtNTLM_NegotiateLanManagerKeyt
NTLM_Unknown8tNTLM_NegotiateNTLMtNTLM_NegotiateNTOnlytNTLM_AnonymoustNTLM_NegotiateOemDomainSuppliedt$NTLM_NegotiateOemWorkstationSuppliedt
NTLM_Unknown6tNTLM_NegotiateAlwaysSigntNTLM_TargetTypeDomaintNTLM_TargetTypeServertNTLM_TargetTypeSharetNTLM_NegotiateExtendedSecuritytNTLM_NegotiateIdentifyt
NTLM_Unknown5tNTLM_RequestNonNTSessionKeytNTLM_NegotiateTargetInfot
NTLM_Unknown4Rt
NTLM_Unknown3t
NTLM_Unknown2t
NTLM_Unknown1tNTLM_Negotiate128tNTLM_NegotiateKeyExchangetNTLM_Negotiate56RRR-R<tNoneRRRUR\tFalseRa(((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/smb/ntlm.pyt<module>sl<





#	/		
	

Zerion Mini Shell 1.0