o
    �õ±jª  ã                   @   s2   d dl T d dlmZ dd„ Zedkreƒ  dS dS )é    )Ú*)ÚSERVICE_ACCESS_MASKc                  C   sº  dd l } | jdd�}|jddddd� |jdd	�}d
|_d|_|jddd	�}| ¡ }d
|_d|_|jddd	�}|jddd	� |jddd	� |jdddd� |jdddd� |jddd	�}|jddd	� |jddd	� |jddd	� |jdddd� |jdddd� | ¡ }t|ƒ |j	dk�rY|j
dkrûtƒ D ]a\}}d| }	t|tƒr­|	d 7 }	t|	ƒ q—|jd
u r»|	d!| ¡  7 }	n9|jd
u rì|jd urÌt||jƒ}
n|jd urÜt|jt |j¡ƒ}
ntƒ ‚|	d"t|
ƒt|
ƒf 7 }	n|	d#t|ƒ 7 }	t|	ƒ q—d S |j
dk�r[t|jƒ}d$}	|jd
u �rtd!| ¡  ƒ n<|jd
u �rK|jd u�r*t||jƒ}
n|jd u�r;t|jt |j¡ƒ}
ntƒ ‚|	d"t|
ƒt|
ƒf 7 }	n|	d#t|ƒ 7 }	t|	ƒ d S d S d S )%Nr   z3Pure Python implementation of Mimikatz --and more--)Údescriptionz-vz	--verboseÚcount)ÚactionÚdefaultÚcommands)ÚhelpTÚcmdtypeÚsrvzService related commandsÚcommandÚlszlisting servicesz--userz�user to use in eff mode. If omitted, the current user will be used. Format: "domain\username" for domain users or "username" for local users z--sidz#SID of the user to use in eff mode.z--sddlÚ
store_truez2Security Descriptors will be listed in SDDL format)r   r	   z--effzDEffective permissions will be printed insted of Security DescriptorsÚnamezoperate on specific serviceÚservice_namez)Name of the service to operate on (short)z	Name: %s zError getting SD!zSDDL: %szmax_perm : %s value: %szSD: %sÚ )ÚargparseÚArgumentParserÚadd_argumentÚadd_subparsersÚrequiredÚdestÚ
add_parserÚ
parse_argsÚprintr
   r   Úenumerate_all_service_sdÚ
isinstanceÚstrÚsddlÚto_sddlÚeffÚuserÚ get_maximum_permissions_for_userÚsidÚGetEffectiveRightsFromAclWÚDaclÚSIDÚfrom_stringÚNotImplementedErrorr   ÚhexÚget_service_sdr   )r   ÚparserÚ
subparsersÚservices_groupÚservices_group_subÚsrv_lsÚsrv_nameÚargsÚsrv_sdÚoutputÚmax_perm© r5   ú�/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/winacl/examples/serviceacl.pyÚmain   sv   






ë
×r7   Ú__main__N)Úwinacl.functions.highlevelÚwinacl.dtyp.acer   r7   Ú__name__r5   r5   r5   r6   Ú<module>   s   K
ÿ