o
    àý°j“˜  ã                   @   sÀ  d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZmZm	Z	 d dl
mZmZ d dlmZmZ d dlmZ d dlmZmZ d dlZG d	d
„ d
ƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdd„ Zedk�r^eejƒ eƒ Z e !e j"e j#¡ eeeedœZ$ze$e j% Z&W n e'y±   e (de j%› �¡ e )d¡ Y nw ee j*ƒ\Z+Z,Z-Z.e+sÇe j%dv rÅdZ+ne.Z+e j/duråz
e j/ 0d¡\Z1Z2W n e3yä   eZ1e j/Z2Y nw dZ1dZ2e-dk�re2dk�re j4r÷n(e j5�re 6d¡ nzed ƒZ-W n e7�y   eƒ  e 8d!¡ e )d"¡ Y nw e j9du�rFdZ:ze j9 0d¡\Z;Z<e;�s5eZ;W nK e3�yE   eZ;e j9Z<Y n=w dZ;dZ<e j=du �rzed#ƒZ:e:ed$ƒk�rfe (d%¡ e )d¡ W n e7�y~   eƒ  e 8d!¡ e )d"¡ Y nw e j=Z:e j>du�rìz
e j> 0d&¡\Z?Z@W n e3�y¡   e+Z?e j>Z@Y nw e jAdu�rÂz
e jA 0d¡\ZBZCW n e3�yÁ   dZBe jAZCY nw dZBdZCdZDe jEdu�rÑe jEZDe jEdu �rëe jAdu �rëe j5�sëe (d'¡ e )d¡ n
e+Z?e,Z@e-ZDe1ZBe2ZCe jFZGe j%d(k�r	eG�s	e #d)¡ d*ZGe&e.e?e@eDeBeCeGe jHe jId+�	ZJe j4�r&eJ Ke,e+e:e;e<¡ZLn'e?e@fe+e,fk�rAe 8d,e+› d&e,› d-e?› d&e@› d.�	¡ eJ Me,e+e-e:e1e2e;e<¡ZLeL�rWe )d ¡ dS e )d¡ dS dS )/é    N)Úgetpass)Úversion)Ú	transportÚsamrÚepm)Ú
kerberosv5Úkpasswd)ÚldapÚldapasn1)Úlogger)Úparse_targetÚEMPTY_LM_HASHc                   @   s^   e Zd ZdZ								ddd„Zdd„ Z								dd	d
„Zdd„ Zddd„ZdS )ÚPasswordHandlerzIGeneric interface for all the password protocols supported by this scriptÚ FNc
           
      C   s:   || _ || _|| _|| _|| _|| _|| _|| _|	| _dS )a°  
        Instantiate password change or reset with the credentials of the account making the changes.
        It can be the target user, or a privileged account.

        :param string address:  IP address or hostname of the server or domain controller where the password will be changed
        :param string domain:   AD domain where the password will be changed
        :param string username: account that will attempt the password change or reset on the target(s)
        :param string password: password of the account that will attempt the password change
        :param string pwdHashLM: LM hash of the account that will attempt the password change
        :param string pwdHashNT: NT hash of the account that will attempt the password change
        :param bool doKerberos: use Kerberos authentication instead of NTLM
        :param string aesKey:   AES key for Kerberos authentication
        :param string kdcHost:  KDC host
        N)	ÚaddressÚdomainÚusernameÚpasswordÚ	pwdHashLMÚ	pwdHashNTÚ
doKerberosÚaesKeyÚkdcHost)
Úselfr   r   ÚauthUsernameÚauthPasswordÚauthPwdHashLMÚauthPwdHashNTr   r   r   © r   úŒ/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/../../../bin/changepasswd.pyÚ__init__Œ   s   
zPasswordHandler.__init__c	           	      C   ó   t ‚)z#Implementation of a password change©ÚNotImplementedError©	r   ÚtargetUsernameÚtargetDomainÚoldPasswordÚnewPasswordÚoldPwdHashLMÚoldPwdHashNTÚnewPwdHashLMÚnewPwdHashNTr   r   r   Ú_changePassword±   s   zPasswordHandler._changePasswordc	           	   
   C   st   |du r#| j }|du r| j}|du r| j}|du r| j}|du r#| j}t d|› d|› �¡ |  ||||||||¡S )a¡  
        Change the password of a target account, knowing the previous password.

        :param string targetUsername: account whose password will be changed, if different from the user performing the change
        :param string targetDomain:   domain of the account
        :param string oldPassword:    current password
        :param string newPassword:    new password
        :param string oldPwdHashLM:   current password, as LM hash
        :param string oldPwdHashMT:   current password, as NT hash
        :param string newPwdHashLM:   new password, as LM hash
        :param string newPwdHashMT:   new password, as NT hash

        :return bool success
        NzChanging the password of ú\)r   r   r   r   r   ÚloggingÚinfor-   r$   r   r   r   ÚchangePassword·   s   ÿzPasswordHandler.changePasswordc                 C   r!   )z Implementation of a password setr"   ©r   r%   r&   r(   r+   r,   r   r   r   Ú_setPasswordã   s   zPasswordHandler._setPasswordc              
   C   sF   |du r| j }t d|› d|› d| j › d| j› �¡ |  |||||¡S )a´  
        Set or Reset the password of a target account, with privileges.

        :param string targetUsername:   account whose password will be changed
        :param string targetDomain:     domain of the account
        :param string newPassword:      new password
        :param string newPwdHashLM:     new password, as LM hash
        :param string newPwdHashMT:     new password, as NT hash

        :return bool success
        NzSetting the password of r.   ú as )r   r/   r0   r   r3   r2   r   r   r   ÚsetPasswordç   s   &zPasswordHandler.setPassword)r   r   r   r   r   Fr   N)NNNr   NNr   r   )Nr   r   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r    r-   r1   r3   r5   r   r   r   r   r   ‰   s.    
ö%
÷,r   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )Ú	KPasswordzTUse Kerberos Change-Password or Set-Password protocols (rfc3244) to change passwordsc	           
   
   C   s¸   || j krt d¡ dS |st d¡ dS z t ||||||| j| jf¡ tj||||||| j| jd� W n tj	tj
fyT }	 zt d|	› �¡ W Y d }	~	dS d }	~	ww t d¡ dS )NzZKPassword does not support changing the password of another user (try setPassword instead)Fú0KPassword requires the new password as plaintext©r   r   zPassword not changed: ú"Password was changed successfully.T)r   r/   ÚcriticalÚdebugr   r   r   r1   r   ÚKerberosErrorÚKPasswdErrorÚerrorr0   )
r   r%   r&   r'   r(   r)   r*   r+   r,   Úer   r   r   r-   þ   sF   


øÿ
ø
€þ
zKPassword._changePasswordc                 C   sª   |s	t  d¡ dS ztj| j| j|||| j| j| j| j	| j
d�
 W n% tjtjfyF } zt  d|› d|› d|› �¡ W Y d }~dS d }~ww t  d|› d|› d�¡ d	S )
Nr;   Fr<   zPassword not changed for r.   ú: z"Password was set successfully for Ú.T)r/   r>   r   r5   r   r   r   r   r   r   r   r   r@   rA   rB   r0   )r   r%   r&   r(   r+   r,   rC   r   r   r   r3   '  s.   

ö€þzKPassword._setPasswordN)r6   r7   r8   r9   r-   r3   r   r   r   r   r:   û   s    )r:   c                   @   sr   e Zd ZdZdZdZdd„ Zddd„Zddd	„Zd
d„ Z	ddœdd„Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )ÚSamrPasswordz>Use MS-SAMR protocol to change or reset the password of a userNFc                 C   r!   )zf
        Return a new transport for our RPC/DCE.

        :return rpc: RPC transport instance
        r"   ©r   r   r   r   ÚrpctransportH  s   zSamrPassword.rpctransportc                 C   sÒ   |   ¡ }t|dƒr(|r|jddddddd� n|j| j| j| j| j| j| jd� |r4d| _	| 
dd¡ nd| _	| 
| j| j¡ |rCdn| j› d	| j› �}t d
|› �¡ | ¡ }| ¡  | tj¡ t d¡ |S )z¨
        Instantiate a new transport and try to authenticate

        :param bool anonymous: Attempt a null binding
        :return dce: DCE/RPC, bound to SAMR
        Úset_credentialsr   )r   r   r   ÚlmhashÚnthashr   )r   TFNznull sessionr.   zConnecting to DCE/RPC as zSuccessfully bound to SAMR)rH   ÚhasattrrI   r   r   r   r   r   r   Ú	anonymousÚset_kerberosr   r   r/   r0   Úget_dce_rpcÚconnectÚbindr   ÚMSRPC_UUID_SAMRr?   )r   rM   rH   Úas_userÚdcer   r   r   ÚauthenticateP  s0   
ú	
zSamrPassword.authenticatec              
      s:  | j rdS z
| jdd�| _ W dS  tyœ ‰  z�t‡ fdd„dD ƒƒrD|r1t d¡ | jdd�| _ n`t d¡ t tˆ ƒ¡ W Y d	‰ Š dS d
tˆ ƒv r]t d¡ t tˆ ƒ¡ W Y d	‰ Š dS dtˆ ƒv rvt d¡ t tˆ ƒ¡ W Y d	‰ Š dS dtˆ ƒv r�t d¡ t tˆ ƒ¡ W Y d	‰ Š dS ˆ ‚W Y d	‰ Š dS d	‰ Š ww )zä
        Connect to SAMR using our transport protocol.

        This method must instantiate self.dce

        :param bool retry_if_expired: Retry as null binding if our password is expired
        :return bool: success
        TF)rM   c                 3   s   � | ]	}|t ˆ ƒv V  qd S )N)Ústr)Ú.0Úmsg©rC   r   r   Ú	<genexpr>‹  s   € z'SamrPassword.connect.<locals>.<genexpr>)ÚSTATUS_PASSWORD_MUST_CHANGEÚSTATUS_PASSWORD_EXPIREDzKPassword is expired or must be changed, trying to bind with a null session.zlCannot set new NTLM hashes when current password is expired. Provide a plaintext value for the new password.NÚSTATUS_LOGON_FAILUREzAAuthentication failure when connecting to RPC: wrong credentials?ÚSTATUS_ACCOUNT_RESTRICTIONz£Account restriction: username and credentials are valid, but some other restriction preventsauthentication, like 'Protected Users' group or time-of-day restrictionÚSTATUS_ACCOUNT_DISABLEDz"The account is currently disabled.)	rT   rU   Ú	ExceptionÚanyr/   Úwarningr>   r?   rV   )r   Úretry_if_expiredr   rY   r   rP   y  sD   
 â
ÿ
ÿ

è€âzSamrPassword.connectc              
   C   s8  z?t  | j| jd ¡d }t  | j|| j¡d }t j| j||d�d }t  | j||f¡d d d }t j| j||d	�d
 }W |S  t	y› } zPdt
|ƒv r`t d¡ t t
|ƒ¡ W Y d}~dS | jr|dt
|ƒv r|t d¡ t t
|ƒ¡ W Y d}~dS dt
|ƒv r•t d¡ t t
|ƒ¡ W Y d}~dS |‚d}~ww )z!Open an handle on the target userú ÚServerHandleÚDomainId)ÚdomainIdÚDomainHandleÚRelativeIdsÚElementr   )ÚuserIdÚ
UserHandleÚSTATUS_NO_SUCH_DOMAINziWrong realm. Try to set the domain name for the target user account explicitly in format DOMAIN/username.NFÚSTATUS_ACCESS_DENIEDznOur anonymous session cannot get a handle to the target user. Retry with a user whose password is not expired.zAccess denied)r   ÚhSamrConnectrT   r   ÚhSamrLookupDomainInSamServerr   ÚhSamrOpenDomainÚhSamrLookupNamesInDomainÚhSamrOpenUserr`   rV   r/   r>   r?   rM   )r   r   ÚserverHandleÚ	domainSIDÚdomainHandleÚuserRIDÚ
userHandlerC   r   r   r   rs   ª  s6   êÿÿ
€ìzSamrPassword.hSamrOpenUserT©Ú_changec             
   O   s   t  d|j› �¡ z|| jg|¢R i |¤Ž}W nP tyg } zDdt|ƒv r8t  d¡ t  t|ƒ¡ W Y d}~dS dt|ƒv ra|rFt  d¡ nt  | j› d| j› d	�¡ t  t|ƒ¡ W Y d}~dS |‚d}~ww |d
 dkrut  	d¡ dS t  
d¡ | ¡  dS )aš  
        Handles common errors when changing/resetting the password, regardless of the procedure

        :param callable samrProcedure: Function that will send the SAMR call
                                args and kwargs are passed verbatim
        :param bool _change:    Used for more precise error reporting,
                                True if it is a password change, False if it is a reset
        zSending SAMR call ÚSTATUS_PASSWORD_RESTRICTIONz¬Some password update rule has been violated. For example, the password history policy may prohibit the use of recent passwords or the password may not meet length criteria.NFrn   z7Target user is not allowed to change their own passwordr.   z6 user is not allowed to set the password of the targetÚ	ErrorCoder   r=   Tz/Non-zero return code, something weird happened.)r/   r?   r6   rT   r`   rV   r>   r   r   r0   rB   Údump)r   ÚsamrProcedurerz   ÚargsÚkwargsÚresprC   r   r   r   Ú_SamrWrapperÊ  s2   	ÿ€ð

zSamrPassword._SamrWrapperc              
   C   s   | j tjd|||||dd�S )Nrd   Try   )r‚   r   ÚhSamrUnicodeChangePasswordUser2)r   r   r'   r(   r)   r*   r+   r,   r   r   r   rƒ   ð  s   øz,SamrPassword.hSamrUnicodeChangePasswordUser2c           	   
   C   s.   |   |¡}|s	dS | jtj||||||dd�S )NFT)r'   r(   r*   r+   r,   rz   )rs   r‚   r   ÚhSamrChangePasswordUser)	r   r   r'   r(   r)   r*   r+   r,   rx   r   r   r   r„   þ  s   
øz$SamrPassword.hSamrChangePasswordUserc                 C   s(   |   |¡}|s	dS | jtj|||dd�S )NFry   )rs   r‚   r   ÚhSamrSetNTInternal1)r   r   r(   r+   r,   rx   r   r   r   ÚhSamrSetInformationUser  s   
z$SamrPassword.hSamrSetInformationUserc	           
   	   C   sR   | j dd�sdS |r|  |||||dd¡S |  ||d||||¡}	|	r't d¡ |	S )NT©rc   Fr   ztUser might need to change their password at next logon because we set hashes (unless password never expires is set).)rP   rƒ   r„   r/   rb   )
r   r%   r&   r'   r(   r)   r*   r+   r,   Úresr   r   r   r-     s   ÿÿ
zSamrPassword._changePasswordc                 C   s2   | j dd�sdS |  ||||¡}|rt d¡ |S )NFr‡   zWUser no longer has valid AES keys for Kerberos, until they change their password again.)rP   r†   r/   rb   )r   r%   r&   r(   r+   r,   rˆ   r   r   r   r3   +  s   
zSamrPassword._setPassword)F)r6   r7   r8   r9   rT   rM   rH   rU   rP   rs   r‚   rƒ   r„   r†   r-   r3   r   r   r   r   rF   A  s    

)1 &rF   c                       s0   e Zd Zdd„ Z‡ fdd„Z‡ fdd„Z‡  ZS )ÚRpcPasswordc                 C   s.   t j| jtjdd�}t |¡}| | j¡ |S )NÚncacn_ip_tcp)Úprotocol)r   Úhept_mapr   r   rR   r   ÚDCERPCTransportFactoryÚsetRemoteHost)r   ÚstringBindingrH   r   r   r   rH   7  s   
zRpcPassword.rpctransportc	           	   
      s(   |st  d¡ tƒ  ||||||||¡S )NzmMS-RPC transport requires new password in plaintext in default Active Directory configuration. Trying anyway.)r/   rb   Úsuperr-   r$   ©Ú	__class__r   r   r-   =  s   ÿÿzRpcPassword._changePasswordc                    s   t  d¡ tƒ  |||||¡S )NzhMS-RPC transport does not allow password reset in default Active Directory configuration. Trying anyway.)r/   rb   r�   r3   r2   r‘   r   r   r3   H  s   ÿzRpcPassword._setPassword)r6   r7   r8   rH   r-   r3   Ú__classcell__r   r   r‘   r   r‰   6  s    r‰   c                   @   s   e Zd Zdd„ ZdS )ÚSmbPasswordc                 C   s   t j| jdd�S )Nz\samr)Úfilename)r   ÚSMBTransportr   rG   r   r   r   rH   P  s   zSmbPassword.rpctransportN)r6   r7   r8   rH   r   r   r   r   r”   O  s    r”   c                   @   sH   e Zd ZdZdZdZdd„ Zdd„ Zdd„ Zd	d
„ Z	dd„ Z
dd„ ZdS )ÚLdapPasswordz-Use LDAP to change or reset a user's passwordNc                 C   s  | j rdS d| j }dd | d¡¡ | _t d|› d| j› d| j› �¡ z0t	 
|| j| j¡}| jsA| | j| j| j| j| j¡ n|j| j| j| j| j| j| j| jd	� W n+ t	jtjjfy€ } zt d
|› d| j› d| j› d|› �¡ W Y d}~dS d}~ww || _ dS )z:Connect to LDAPS with the credentials provided in __init__Tzldaps://zDC=z,DC=rE   zConnecting to r4   r.   ©r   zCannot connect to rD   NF)ÚldapConnectionr   ÚjoinÚsplitÚbaseDNr/   r?   r   r   r	   ÚLDAPConnectionr   Úloginr   r   r   ÚkerberosLoginr   r   ÚLDAPSessionErrorÚOpenSSLÚSSLÚSysCallErrorrB   )r   r&   ÚldapURIr™   rC   r   r   r   rP   Z  s4   
 ù€	&€þzLdapPassword.connectc                 C   s   d|› d�  d¡S )z�
        Encode the password according to Microsoft's specifications

        Password must be surrounded by quotes and UTF-16 encoded
        ú"z	utf-16-le)Úencode)r   r   r   r   r   ÚencodeLdapPasswordy  s   zLdapPassword.encodeLdapPasswordc                 C   sF   | j jd|› d�| jdd�}|D ]}t|tjƒsqt|d ƒ  S dS )z Find the DN of the targeted userz(sAMAccountName=ú))ÚdistinguishedName)ÚsearchFilterÚ
searchBaseÚ
attributesÚ
objectNameN)r™   Úsearchrœ   Ú
isinstancer
   ÚSearchResultEntryrV   )r   r%   r&   ÚanswersÚitemr   r   r   ÚfindTargetDN�  s   
ýûzLdapPassword.findTargetDNc              	   C   s  |   |¡sdS |  ||¡}|st d¡ dS t d|› �¡ t ¡ }||d< |rkt d¡|d d d< d	|d d d
 d< ||d d d
 d d< t d¡|d d d< d	|d d d
 d< ||d d d
 d d< n!t d¡|d d d< d	|d d d
 d< ||d d d
 d d< t dt|ƒ› �¡ | j	 
|¡d }t dt|ƒ› �¡ t|d d d ƒ}	tt |	¡ƒ}
t|d d d ƒ}|
dkrÑt d|› �¡ dS |
dkràt d|› d�¡ dS |
dkr÷t d|› d| j› d| j› d �¡ dS t d|› d!|
› d"|› �¡ dS )#NFz&Could not find the target user in LDAPz Found target distinguishedName: ÚobjectÚdeleteÚchangesr   Ú	operationÚ
unicodePwdÚmodificationÚtypeÚvalsÚaddé   Úreplacez	Sending: zReceiving: Ú
protocolOpÚmodifyResponseÚ
resultCodeÚdiagnosticMessageÚsuccessz&Password was changed successfully for TÚconstraintViolationz!Could not change the password of z@, possibly due to the password policy or an invalid oldPassword.ÚinsufficientAccessRightszCould not set the password of z, r.   z has insufficient rightsz. rD   )rP   r³   r/   r>   r?   r
   ÚModifyRequestÚ	OperationrV   r™   ÚsendReceiveÚintÚ
ResultCoder0   rB   r   r   )r   Úchanger%   r&   ÚoldPasswordEncodedÚnewPasswordEncodedÚtargetDNÚrequestÚresponserÁ   ÚresultÚdiagMessager   r   r   Ú_modifyPassword’  sL   


ÿ	û"þzLdapPassword._modifyPasswordc	                 C   s<   |r|st  d¡ dS |  |¡}	|  |¡}
|  d|||	|
¡S )z¹
        Change the password of a user.

        Must send a delete operation with the oldPassword and an add
        operation with the newPassword in the same modify request.
        z4LDAP requires the old and new passwords in plaintextFT©r/   r>   r§   rÓ   )r   r%   r&   r'   r(   r)   r*   r+   r,   rÌ   rÍ   r   r   r   r-   Ç  s   



zLdapPassword._changePasswordc                 C   s.   |s	t  d¡ dS |  |¡}|  d||d|¡S )z€
        Set the password of a user.

        Must send a modify operation with the newPassword (must have privileges).
        z+LDAP requires the new password in plaintextFNrÔ   )r   r%   r&   r(   r+   r,   rÍ   r   r   r   r3   Ù  s
   

zLdapPassword._setPassword)r6   r7   r8   r9   r™   rœ   rP   r§   r³   rÓ   r-   r3   r   r   r   r   r—   T  s    5r—   c                  C   sˆ  t jdd�} | jdddd� | jddd	d� | jd
ddd� |  d¡}| ¡ }|jddd dd� |jddd ddd� |  d¡}|jddd ddd� |jdddd� |  d¡}|jddd dd� | ¡ }|jddd dd� |jdddd d d� |  d!¡}|jd"d#dd$d%d&d'� |jd(d)dd*d� | jd+d,d�}|jd-dd.d� |jd/dd0d1d2� |jd3dd4d5d2� ttjƒd6krÀ|  ¡  t 	d6¡ |  
¡ S )7Nz3Change or reset passwords over different protocols.)ÚdescriptionÚtargetÚstorez4[[domain/]username[:password]@]<hostname or address>)ÚactionÚhelpz-tsÚ
store_truez&adds timestamp to every logging outputz-debugzturn DEBUG output ONzNew credentials for targetz-newpassznew password)rØ   ÚdefaultrÙ   z
-newhasheszLMHASH:NTHASHz2new NTLM hashes, format is NTHASH or LMHASH:NTHASH)rØ   rÛ   ÚmetavarrÙ   z6Authentication (target user whose password is changed)z-hashesz.NTLM hashes, format is NTHASH or LMHASH:NTHASHz-no-passz0Don't ask for password (useful for Kerberos, -k)z@Authentication (optional, privileged user performing the change)z-altuserzAlternative usernamez-altpasszAlternative passwordz-althashz
-althashesz6Alternative NT hash, format is NTHASH or LMHASH:NTHASHzMethod of operationsz	-protocolz-pz)Protocol to use for password change/resetúsmb-samr)rÝ   úrpc-samrr   r	   )rØ   rÙ   rÛ   Úchoicesz-resetz-adminzMTry to reset the password with privileges (may bypass some password policies)zKerberos authenticationzHApplicable to the authenticating user (-altuser if defined, else target)z-kzÁUse Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot be found, it will use the ones specified in the command linez-aesKeyzhex keyz<AES key to use for Kerberos Authentication (128 or 256 bits))rØ   rÜ   rÙ   z-dc-ipz
ip addressz‚IP Address of the domain controller, for Kerberos. If omitted it will use the domain part (FQDN) specified in the target parameterr½   )ÚargparseÚArgumentParserÚadd_argumentÚadd_argument_groupÚadd_mutually_exclusive_groupÚlenÚsysÚargvÚ
print_helpÚexitÚ
parse_args)ÚparserÚgroupÚexgroupr   r   r   rê   ç  s€   ÿ
û

ÿ

ÿ
úüÿüÿû

rê   Ú__main__)r   rÞ   rÝ   r	   zUnsupported password protocol r½   )rÞ   rÝ   ÚBuiltinú:r   z/Current password not given: will use KRB5CCNAMEzCurrent password: Ú	Cancelledé‚   zNew password: zRetype new password: z"Passwords do not match, try again.ú/z‘Please, provide either alternative password (-altpass) or NT hash (-althash) for authentication, or specify -no-pass if you rely on Kerberos onlyr   zAUsing the KPassword protocol implies Kerberos authentication (-k)Tr˜   z'Attempting to *change* the password of r4   zE. You may want to use '-reset' to *reset* the password of the target.)Nrà   r/   ræ   r   Úimpacketr   Úimpacket.dcerpc.v5r   r   r   Úimpacket.krb5r   r   Úimpacket.ldapr	   r
   Úimpacket.examplesr   Úimpacket.examples.utilsr   r   r¡   r   r:   rF   r‰   r”   r—   rê   r6   ÚprintÚBANNERÚoptionsÚinitÚtsr?   Úhandlersr‹   ÚPasswordProtocolÚKeyErrorr>   ré   rÖ   r&   r%   r'   r   Úhashesr›   r)   r*   Ú
ValueErrorÚresetÚno_passr0   ÚKeyboardInterruptrb   Ú	newhashesr(   r+   r,   ÚnewpassÚaltuserÚ
authDomainr   Úalthashr   r   r   ÚaltpassÚkr   r   Údc_ipÚhandlerr5   Úretr1   r   r   r   r   Ú<module>   s$  xrF v 
V
üþ


þ
ý€
þ

€
ý
þ
þ ÿ
€
÷ÿÿ �í