o
    j	                     @   s   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZmZmZmZmZmZmZmZ d dlmZmZ d dlmZmZm Z  G dd deZ!dd Z"e#dkr~d dl$Z$e$%e"  dS dS )    )SMBDCEFactory)wkst)EPM)MAXIMUM_ALLOWED)NTStatus)logger)NULL)SMBConnection)DCERPC5Connection)RPC_C_AUTHN_LEVEL_NONERPC_C_AUTHN_LEVEL_CONNECTRPC_C_AUTHN_LEVEL_CALLRPC_C_AUTHN_LEVEL_PKTRPC_C_AUTHN_LEVEL_PKT_INTEGRITYRPC_C_AUTHN_LEVEL_PKT_PRIVACYDCERPCExceptionRPC_C_AUTHN_GSS_NEGOTIATE)InterfaceManagerInterfaceEndpoint)MSRPC_UUID_DFSNMhRpcNetrDfsAddStdRoothNetrDfsRemoveStdRootc                       sT   e Zd Z fddZedd Zedd Zdd Ze	d	fd
dZ
dddZ  ZS )DFSNMRPCc                    s   t  || d S N)super__init__)self
connectionendpoint	__class__ /root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/aiosmb/dcerpc/v5/interfaces/dfsnmmgr.pyr      s   zDFSNMRPC.__init__c                 C   s"   t ddddtdt dddtdgS )Nncan_npz$4fc742e0-4a10-11cf-8273-00aa004ae673z3.0z\netdfs)pipename	authlevelncacn_ip_tcp)r%   )r   r   clsr!   r!   r"   	endpoints   s   zDFSNMRPC.endpointsc                 C   s
   t | |S r   )r   )r   r   r!   r!   r"   create_instance"   s   
zDFSNMRPC.create_instancec                    s   d S r   r!   r'   r!   r!   r"   cleanup&   s   zDFSNMRPC.cleanupr   c                    s   t | j||||dI d H S )N)	RootShareCommentApiFlags)r   dce)r   
serverName	rootSharecommentflagsr!   r!   r"   r   )   s   zDFSNMRPC.hRpcNetrDfsAddStdRootc                    s   t | j|||dI d H S )N)r,   r.   )r   r/   )r   r0   r1   r3   r!   r!   r"   r   ,   s   zDFSNMRPC.hNetrDfsRemoveStdRoot)r   )__name__
__module____qualname__r   classmethodr)   staticmethodr*   r+   r   r   r   __classcell__r!   r!   r   r"   r      s    

r   c               	      s   d} d}d}d}t | |||I d H \}}|d ur|t| |4 I d H & td |dddI d H \}}|d ur=|t| W d   I d H  d S 1 I d H sRw   Y  d S )Nz192.168.56.11hodorNORTH   z#\\192.168.56.129/aaa\share\file.txtaaar   )r   from_ntlm_paramsprintr   )hostuserpassworddomainrpcerrresr!   r!   r"   amain0   s    
.rG   __main__N)&0aiosmb.dcerpc.v5.common.connection.smbdcefactoryr   aiosmb.dcerpc.v5r   'aiosmb.dcerpc.v5.interfaces.endpointmgrr   aiosmb.dcerpc.v5.dtypesr   aiosmb.wintypes.ntstatusr   aiosmbr   r   aiosmb.connectionr	   aiosmb.dcerpc.v5.connectionr
   aiosmb.dcerpc.v5.rpcrtr   r   r   r   r   r   r   r   aiosmb.dcerpc.v5.interfacesr   r   aiosmb.dcerpc.v5.dfsnmr   r   r   r   rG   r4   asynciorunr!   r!   r!   r"   <module>   s&    (