%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/samba/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/samba/__pycache__/descriptor.cpython-312.pyc

�

�de}���dZddlmZddlmZddlmZddlZddlZd�Z	d"d�Z
d"d�Zd"d	�Zd"d
�Z
d"d�Zd"d�Zd"d
�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd"d�Zd�Z d�Z!d�Z"d �Z#		d#d!�Z$y)$zFFunctions for setting up a Samba configuration (security descriptors).�)�security)�ndr_pack)�get_schema_descriptorNc��d|z}|j�D]\}}|j||�}�tjj	||�}t|�S)N�%s)�items�replacer�
descriptor�	from_sddlr)�sddl_in�
domain_sid�name_map�sddl�name�sid�secs       �2/usr/lib/python3/dist-packages/samba/descriptor.py�sddl2binaryr&sY���'�>�D��~�~�'�'���s��|�|�D�#�&��'��
�
�
'�
'��j�
9�C��C�=��c�(�|�i}d}t|||�S)N��r�r
rrs   r�get_empty_descriptorr0s!������
�D��t�Z��2�2rc�(�|�i}d}t|||�S)Nz9O:SYG:SYD:PAI(A;;RPWPCCDCLCRCWOWDSDSW;;;SY)(A;;RPLC;;;BA)rrs   r�get_deletedobjects_descriptorr:s%�������D��t�Z��2�2rc�(�|�i}d}t|||�S)NaO:EAG:EAD:(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ac-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ac-9c07-11d1-f79f-00c04fc2dcd2;;BA)(A;;RPLCLORC;;;AU)(A;CI;RPWPCRCCDCLCLORCWOWDSDDTSW;;;EA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;CIIO;RPWPCRCCLCLORCWOWDSDSW;;;DA)(OA;;CR;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;89e95b76-444d-4c62-991a-0facbeda640c;;ED)(OA;;CR;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;89e95b76-444d-4c62-991a-0facbeda640c;;BA)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;RO)S:(AU;SA;WPWOWD;;;WD)(AU;SA;CR;;;BA)(AU;SA;CR;;;DU)(OU;SA;CR;45ec5156-db7e-47bb-b53f-dbeb2d03c40f;;WD)rrs   r�get_config_descriptorrDs&������A�D��t�Z��2�2rc�(�|�i}d}t|||�S)NaD:(A;;LCLORC;;;AU)(OA;;RP;e48d0154-bcf8-11d1-8702-00c04fb96050;;AU)(OA;;RP;d31a8757-2447-4545-8081-3bb610cacbf2;;AU)(OA;;RP;66171887-8f3c-11d0-afda-00c04fd930c9;;AU)(OA;;RP;032160bf-9824-11d1-aec0-0000f80367c1;;AU)(OA;;RP;789ee1eb-8c8e-4e4c-8cec-79b31b7617b5;;AU)(OA;;RP;5706aeaf-b940-4fb2-bcfc-5268683ad9fe;;AU)(A;;RPWPCRCCLCLORCWOWDSW;;;EA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;CC;;;ED)(OA;CIIO;WP;3df793df-9858-4417-a701-735a1ecebf74;bf967a8d-0de6-11d0-a285-00aa003049e2;BA)S:(AU;CISA;WPCRCCDCWOWDSDDT;;;WD)rrs   r� get_config_partitions_descriptorr Zs%������
*�D��t�Z��2�2rc�(�|�i}d}t|||�S)NaD:(A;;RPLCLORC;;;AU)(OA;CIIO;SW;d31a8757-2447-4545-8081-3bb610cacbf2;f0f8ffab-1191-11d0-a060-00aa006c33ed;RO)(A;;RPWPCRCCLCLORCWOWDSW;;;EA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)S:(AU;CISA;CCDCSDDT;;;WD)(OU;CIIOSA;CR;;f0f8ffab-1191-11d0-a060-00aa006c33ed;WD)(OU;CIIOSA;WP;f30e3bbe-9ff0-11d1-b603-0000f80367c1;bf967ab3-0de6-11d0-a285-00aa003049e2;WD)(OU;CIIOSA;WP;f30e3bbf-9ff0-11d1-b603-0000f80367c1;bf967ab3-0de6-11d0-a285-00aa003049e2;WD)(OU;CIIOSA;WP;3e10944c-c354-11d0-aff8-0000f80367c1;b7b13124-b82e-11d0-afee-0000f80367c1;WD)rrs   r�get_config_sites_descriptorr"os&������
f�D��t�Z��2�2rc�(�|�i}d}t|||�S)NziD:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;EA)(A;;RPLCLORC;;;BA)(OA;;CR;4ecc03fe-ffc0-4947-b630-eb672a8a9dbc;;WD)rrs   r�!get_config_ntds_quotas_descriptorr$�s%������<�D��t�Z��2�2rc�(�|�i}d}t|||�S)NzXD:AI(A;;RPLCLORC;;;AU)(A;;RPWPCRCCLCLORCWOWDSW;;;EA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)rrs   r�'get_config_delete_protected1_descriptorr&��%������/�D��t�Z��2�2rc�(�|�i}d}t|||�S)NzXD:AI(A;;RPLCLORC;;;WD)(A;;RPWPCRCCLCLORCWOWDSW;;;EA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)rrs   r�)get_config_delete_protected1wd_descriptorr)�r'rc�(�|�i}d}t|||�S)NzZD:AI(A;;RPLCLORC;;;AU)(A;;RPWPCRCCDCLCLORCWOWDSW;;;EA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)rrs   r�'get_config_delete_protected2_descriptorr+�r'rc�(�|�i}d}t|||�S)Na�O:BAG:BAD:AI(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;5f202010-79a5-11d0-9020-00c04fc2d4cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;5f202010-79a5-11d0-9020-00c04fc2d4cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;bc0ac240-79a9-11d0-9020-00c04fc2d4cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;bc0ac240-79a9-11d0-9020-00c04fc2d4cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;59ba2f42-79a2-11d0-9020-00c04fc2d3cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;59ba2f42-79a2-11d0-9020-00c04fc2d3cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;037088f8-0ae1-11d2-b422-00a0c968f939;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;037088f8-0ae1-11d2-b422-00a0c968f939;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;RO)(OA;;CR;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;DD)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967a86-0de6-11d0-a285-00aa003049e2;ED)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967a9c-0de6-11d0-a285-00aa003049e2;ED)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967aba-0de6-11d0-a285-00aa003049e2;ED)(OA;;CR;89e95b76-444d-4c62-991a-0facbeda640c;;BA)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ac-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ae-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;e2a36dc9-ae17-47c3-b58b-be34c55ba633;;S-1-5-32-557)(OA;;RP;c7407360-20bf-11d0-a768-00aa006e0529;;RU)(OA;;RP;b8119fd0-04f6-4762-ab7a-4986c76b3f9a;;RU)(OA;CIIO;RPLCLORC;;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RPLCLORC;;bf967a9c-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RPLCLORC;;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;;CR;05c74c5e-4deb-43b4-bd9f-86664c2a7fd5;;AU)(OA;;CR;89e95b76-444d-4c62-991a-0facbeda640c;;ED)(OA;;CR;ccc2dc7d-a6ad-4a7a-8846-c04e3cc53501;;AU)(OA;;CR;280f369c-67c7-438e-ae98-1d46f3c6f541;;AU)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ac-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ae-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;RP;b8119fd0-04f6-4762-ab7a-4986c76b3f9a;;AU)(OA;CIIO;RPWPCR;91e647de-d96f-4b70-9557-d63ff4f3ccd8;;PS)(OA;CIIO;WP;ea1b7b93-5e48-46d5-bc6c-4df4fda78a35;bf967a86-0de6-11d0-a285-00aa003049e2;PS)(OA;;CR;3e0f7e18-2c7a-4c10-ba82-4d926db99a3e;;CN)(OA;OICI;RPWP;3f78c3e5-f79a-46bd-a0b8-9d18116ddc79;;PS)(OA;CI;RPWP;5b47d60f-6090-40b2-9f37-2a4de88f3063;;KA)(OA;CI;RPWP;5b47d60f-6090-40b2-9f37-2a4de88f3063;;EK)(OA;CIIO;SW;9b026da6-0d3c-465c-8bee-5199d7165cba;bf967a86-0de6-11d0-a285-00aa003049e2;PS)(OA;CIIO;SW;9b026da6-0d3c-465c-8bee-5199d7165cba;bf967a86-0de6-11d0-a285-00aa003049e2;CO)(A;;RPWPCRCCLCLORCWOWDSW;;;DA)(A;CI;RPWPCRCCDCLCLORCWOWDSDDTSW;;;EA)(A;;RPRC;;;RU)(A;CI;LC;;;RU)(A;CI;RPWPCRCCLCLORCWOWDSDSW;;;BA)(A;;RP;;;WD)(A;;RPLCLORC;;;ED)(A;;RPLCLORC;;;AU)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)S:AI(OU;CISA;WP;f30e3bbe-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(OU;CISA;WP;f30e3bbf-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(AU;SA;CR;;;DU)(AU;SA;CR;;;BA)(AU;SA;WPWOWD;;;WD)rrs   r�get_domain_descriptorr-�s&������7<�D�p�t�Z��2�2rc�(�|�i}d}t|||�S)NziD:(A;;RPLCLORC;;;AU)(A;;RPWPCRCCLCLORCWOWDSW;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)S:(AU;SA;WPCR;;;WD)rrs   r�$get_domain_infrastructure_descriptorr/�s%�������D��t�Z��2�2rc�(�|�i}d}t|||�S)NaLD:(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;5f202010-79a5-11d0-9020-00c04fc2d4cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;5f202010-79a5-11d0-9020-00c04fc2d4cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;bc0ac240-79a9-11d0-9020-00c04fc2d4cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;bc0ac240-79a9-11d0-9020-00c04fc2d4cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;59ba2f42-79a2-11d0-9020-00c04fc2d3cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;59ba2f42-79a2-11d0-9020-00c04fc2d3cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;037088f8-0ae1-11d2-b422-00a0c968f939;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;037088f8-0ae1-11d2-b422-00a0c968f939;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;RO)(OA;;CR;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;DD)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967a86-0de6-11d0-a285-00aa003049e2;ED)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967a9c-0de6-11d0-a285-00aa003049e2;ED)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967aba-0de6-11d0-a285-00aa003049e2;ED)(OA;;CR;89e95b76-444d-4c62-991a-0facbeda640c;;BA)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ac-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ae-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;e2a36dc9-ae17-47c3-b58b-be34c55ba633;;S-1-5-32-557)(OA;;RP;c7407360-20bf-11d0-a768-00aa006e0529;;RU)(OA;;RP;b8119fd0-04f6-4762-ab7a-4986c76b3f9a;;RU)(OA;CIIO;RPLCLORC;;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RPLCLORC;;bf967a9c-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RPLCLORC;;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;;CR;05c74c5e-4deb-43b4-bd9f-86664c2a7fd5;;AU)(OA;;CR;89e95b76-444d-4c62-991a-0facbeda640c;;ED)(OA;;CR;ccc2dc7d-a6ad-4a7a-8846-c04e3cc53501;;AU)(OA;;CR;280f369c-67c7-438e-ae98-1d46f3c6f541;;AU)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ac-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ae-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;RP;b8119fd0-04f6-4762-ab7a-4986c76b3f9a;;AU)(OA;CIIO;RPWPCR;91e647de-d96f-4b70-9557-d63ff4f3ccd8;;PS)(OA;CIIO;SW;9b026da6-0d3c-465c-8bee-5199d7165cba;bf967a86-0de6-11d0-a285-00aa003049e2;CO)(OA;OICI;RPWP;3f78c3e5-f79a-46bd-a0b8-9d18116ddc79;;PS)(OA;CIIO;SW;9b026da6-0d3c-465c-8bee-5199d7165cba;bf967a86-0de6-11d0-a285-00aa003049e2;PS)(OA;CIIO;WP;ea1b7b93-5e48-46d5-bc6c-4df4fda78a35;bf967a86-0de6-11d0-a285-00aa003049e2;PS)(A;;RPWPCRCCLCLORCWOWDSW;;;DA)(A;CI;RPWPCRCCDCLCLORCWOWDSDDTSW;;;EA)(A;;RPRC;;;RU)(A;CI;LC;;;RU)(A;CI;RPWPCRCCLCLORCWOWDSDSW;;;BA)(A;;RP;;;WD)(A;;RPLCLORC;;;ED)(A;;RPLCLORC;;;AU)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)S:(OU;CISA;WP;f30e3bbe-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(OU;CISA;WP;f30e3bbf-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(AU;SA;CR;;;DU)(AU;SA;CR;;;BA)(AU;SA;WPWOWD;;;WD)rrs   r�get_domain_builtin_descriptorr1�s&������8�D�r�t�Z��2�2rc�(�|�i}d}t|||�S)NaYD:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPWPCRCCDCLCLORCWOWDSW;;;DA)(OA;;CCDC;bf967a86-0de6-11d0-a285-00aa003049e2;;AO)(OA;;CCDC;bf967aba-0de6-11d0-a285-00aa003049e2;;AO)(OA;;CCDC;bf967a9c-0de6-11d0-a285-00aa003049e2;;AO)(OA;;CCDC;bf967aa8-0de6-11d0-a285-00aa003049e2;;PO)(A;;RPLCLORC;;;AU)(OA;;CCDC;4828cc14-1437-45bc-9b07-ad6f015e5f28;;AO)S:rrs   r�get_domain_computers_descriptorr39s%������	
�D��t�Z��2�2rc�(�|�i}d}t|||�S)Na&D:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPWPCRCCDCLCLORCWOWDSW;;;DA)(OA;;CCDC;bf967aba-0de6-11d0-a285-00aa003049e2;;AO)(OA;;CCDC;bf967a9c-0de6-11d0-a285-00aa003049e2;;AO)(OA;;CCDC;bf967aa8-0de6-11d0-a285-00aa003049e2;;PO)(A;;RPLCLORC;;;AU)(OA;;CCDC;4828cc14-1437-45bc-9b07-ad6f015e5f28;;AO)S:rrs   r�get_domain_users_descriptorr5Js%������
�D��t�Z��2�2rc�(�|�i}d}t|||�S)Nz�D:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPWPCRCCDCLCLORCWOWDSW;;;DA)(OA;;CCDC;ce206244-5827-4a86-ba1c-1c0c386c1b64;;AO)(OA;;CCDC;bf967aba-0de6-11d0-a285-00aa003049e2;;AO)(OA;;CCDC;bf967a9c-0de6-11d0-a285-00aa003049e2;;AO)(A;;RPLCLORC;;;AU)S:rrs   r�'get_managed_service_accounts_descriptorr7Zs%������
�D��t�Z��2�2rc�(�|�i}d}t|||�S)Nz�D:(A;;RPLCLORC;;;AU)(A;;RPWPCRCCLCLORCWOWDSW;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPLCLORC;;;ED)S:(AU;SA;CCDCWOWDSDDT;;;WD)(AU;CISA;WP;;;WD)rrs   r�!get_domain_controllers_descriptorr9is%�������D��t�Z��2�2rc�(�|�i}d}t|||�S)NzXD:AI(A;;RPLCLORC;;;AU)(A;;RPWPCRCCLCLORCWOWDSW;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)rrs   r�'get_domain_delete_protected1_descriptorr;xr'rc�(�|�i}d}t|||�S)NzZD:AI(A;;RPLCLORC;;;AU)(A;;RPWPCRCCDCLCLORCWOWDSW;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)rrs   r�'get_domain_delete_protected2_descriptorr=�r'rc�(�|�i}d}t|||�S)NaXO:SYG:BAD:AI(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;5f202010-79a5-11d0-9020-00c04fc2d4cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;5f202010-79a5-11d0-9020-00c04fc2d4cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;bc0ac240-79a9-11d0-9020-00c04fc2d4cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;bc0ac240-79a9-11d0-9020-00c04fc2d4cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;59ba2f42-79a2-11d0-9020-00c04fc2d3cf;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;59ba2f42-79a2-11d0-9020-00c04fc2d3cf;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RP;037088f8-0ae1-11d2-b422-00a0c968f939;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RP;037088f8-0ae1-11d2-b422-00a0c968f939;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;RO)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967a86-0de6-11d0-a285-00aa003049e2;ED)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967a9c-0de6-11d0-a285-00aa003049e2;ED)(OA;CIIO;RP;b7c69e6d-2cc7-11d2-854e-00a0c983f608;bf967aba-0de6-11d0-a285-00aa003049e2;ED)(OA;;CR;89e95b76-444d-4c62-991a-0facbeda640c;;BA)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ac-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;1131f6ae-9c07-11d1-f79f-00c04fc2dcd2;;BA)(OA;;CR;e2a36dc9-ae17-47c3-b58b-be34c55ba633;;S-1-5-32-557)(OA;;RP;c7407360-20bf-11d0-a768-00aa006e0529;;RU)(OA;;RP;b8119fd0-04f6-4762-ab7a-4986c76b3f9a;;RU)(OA;CIIO;RPLCLORC;;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)(OA;CIIO;RPLCLORC;;bf967a9c-0de6-11d0-a285-00aa003049e2;RU)(OA;CIIO;RPLCLORC;;bf967aba-0de6-11d0-a285-00aa003049e2;RU)(OA;;CR;05c74c5e-4deb-43b4-bd9f-86664c2a7fd5;;AU)(OA;;CR;89e95b76-444d-4c62-991a-0facbeda640c;;ED)(OA;;CR;ccc2dc7d-a6ad-4a7a-8846-c04e3cc53501;;AU)(OA;;CR;280f369c-67c7-438e-ae98-1d46f3c6f541;;AU)(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ac-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;CR;1131f6ae-9c07-11d1-f79f-00c04fc2dcd2;;ED)(OA;;RP;b8119fd0-04f6-4762-ab7a-4986c76b3f9a;;AU)(OA;CIIO;RPWPCR;91e647de-d96f-4b70-9557-d63ff4f3ccd8;;PS)(OA;CIIO;SW;9b026da6-0d3c-465c-8bee-5199d7165cba;bf967a86-0de6-11d0-a285-00aa003049e2;CO)(OA;OICI;RPWP;3f78c3e5-f79a-46bd-a0b8-9d18116ddc79;;PS)(OA;CIIO;SW;9b026da6-0d3c-465c-8bee-5199d7165cba;bf967a86-0de6-11d0-a285-00aa003049e2;PS)(OA;CIIO;WP;ea1b7b93-5e48-46d5-bc6c-4df4fda78a35;bf967a86-0de6-11d0-a285-00aa003049e2;PS)(A;;RPWPCRCCLCLORCWOWDSW;;;DA)(A;CI;RPWPCRCCDCLCLORCWOWDSDDTSW;;;EA)(A;;RPRC;;;RU)(A;CI;LC;;;RU)(A;CI;RPWPCRCCLCLORCWOWDSDSW;;;BA)(A;;RP;;;WD)(A;;RPLCLORC;;;ED)(A;;RPLCLORC;;;AU)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)S:AI(OU;CISA;WP;f30e3bbe-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(OU;CISA;WP;f30e3bbf-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(AU;SA;CR;;;DU)(AU;SA;CR;;;BA)(AU;SA;WPWOWD;;;WD)rrs   r�get_dns_partition_descriptorr?�s&������6<�D�n�t�Z��2�2rc�(�|�i}d}t|||�S)NzTO:SYG:SYD:AI(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;CI;RPWPCRCCDCLCRCWOWDSDDTSW;;;ED)rrs   r�'get_dns_forest_microsoft_dns_descriptorrA�s%������/�D��t�Z��2�2rc�(�|�i}d}t|||�S)Nz�O:SYG:SYD:AI(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)(A;CI;RPWPCRCCDCLCRCWOWDSDDTSW;;;DnsAdmins)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;CI;RPWPCRCCDCLCRCWOWDSDDTSW;;;ED)rrs   r�'get_dns_domain_microsoft_dns_descriptorrC�s%������/�D�
�t�Z��2�2rc�(�|�i}d}t|||�S)Nz�O:SubdomainAdminsG:SubdomainAdminsD:AI(A;;RPWPCRCCLCLORCWOWDSW;;;SubdomainAdmins)(A;;RPLCLORC;;;AU)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)rrs   r�+get_paritions_crossref_subdomain_descriptorrE�r'rc���tj|dt|j��z�tftj|dt|j��z�t
ftj|dt|j��z�tftj|dt|j��z�tftj|dt|j��z�tftj|dt|j��z�tftj|dt|j��z�tftj|dt|j��z�tftj|d	t|j��z�tftj|d
t|j��z�tftj|dt|j��z�tftj|dt|j��z�t
ftj|dt|j��z�t ftj|dt|j��z�t"ftj|d
t|j��z�t$ftj|dt|j��z�t"ftj|dt|j��z�t"ftj|dt|j��z�t"ftj|dt|j��z�t&ftj|dt|j��z�t&ftj|dt|j��z�t(ftj|dt|j��z�t*ftj|dt|j-��z�t.fg}|j1ddtj2dg��}|ddD�]�}tj|dt|j5��z�}tj||j7d��|k(�rtj|dt|�z�t8f}|j;|�tj|dt|�z�t
f}|j;|�tj|dt|�z�tf}|j;|�tj|dt|�z�tf}|j;|�tj|dt|�z�t<f}|j;|���|tj|dt|j��z�}tj||j7d��|k(s���tj|dt|�z�t8f}|j;|�tj|dt|�z�t
f}|j;|�tj|dt|�z�tf}|j;|�tj|dt|�z�tf}|j;|�tj|dt|�z�tf}|j;|����|S)NrzCN=Deleted Objects,%szCN=LostAndFound,%szCN=System,%szCN=Infrastructure,%sz
CN=Builtin,%szCN=Computers,%szCN=Users,%szOU=Domain Controllers,%szCN=MicrosoftDNS,CN=System,%szCN=NTDS Quotas,%szCN=LostAndFoundConfig,%szCN=Services,%szCN=Physical Locations,%sz#CN=WellKnown Security Principals,%szCN=ForestUpdates,%szCN=DisplaySpecifiers,%szCN=Extended-Rights,%szCN=Partitions,%szCN=Sites,%sz(objectClass=*)r�namingContexts)�
expression�base�scope�attrsrzDC=ForestDnsZones,%s�utf8zCN=MicrosoftDNS,%szDC=DomainDnsZones,%s)�ldb�Dn�str�	domain_dnr-rr=r;r/r1r3r5r9rC�get_config_basednrr$r)r&r+r r"�get_schema_basednr�search�
SCOPE_BASE�get_root_basedn�decoder?�appendrA)�samdb�
subcontainers�current�nc�dnsforestdn�c�dnsdomaindns       r�get_wellknown_sdsr_�s@��

����t�c�%�/�/�"3�4�4�	5�7L�M�	����.��U�_�_�5F�1G�G�	H�Jg�h�	����+�c�%�/�/�2C�.D�D�	E�Gn�o�	����~��E�O�O�,=�(>�>�	?�Ah�i�	����-��E�O�O�4E�0F�F�	G�Im�n�	������U�_�_�->�)?�?�	@�B_�`�	����(�3�u���/@�+A�A�	B�Dc�d�	����}�s�5�?�?�+<�'=�=�	>�@[�\�	����1�C����8I�4J�J�	K�Mn�o�	����5��E�O�O�<M�8N�N�	O�Qx�y�	����t�c�%�"9�"9�";�<�<�	=�?T�U�	����.��U�5L�5L�5N�1O�O�	P�Ro�p�	����*�S��1H�1H�1J�-K�K�	L�No�p�	����1�C��8O�8O�8Q�4R�R�	S�U~��	����'�#�e�.E�.E�.G�*H�H�	I�Kr�s�	����1�C��8O�8O�8Q�4R�R�	S�U~��	����<�s�5�CZ�CZ�C\�?]�]�	^�aJ�	K�	����,�s�5�3J�3J�3L�/M�M�	N�Py�z�	����0�3�u�7N�7N�7P�3Q�Q�	R�T{�|�	����.��U�5L�5L�5N�1O�O�	P�Ry�z�	����)�C��0G�0G�0I�,J�J�	K�Mm�n�	����}�s�5�+B�+B�+D�'E�E�	F�Hc�d�	����t�c�%�"9�"9�";�<�<�	=�?T�U�3�M�8�l�l�&7� "�#�.�.�"2�!3��5�G��a�j�)�*�#$���f�f�U�$:�c�%�BW�BW�BY�>Z�$[�\���6�6�%����6�*�+�{�:�����t�c�+�&6�6�7�9U�V�A�� � ��#�����6��[�9I�I�J�.�0�A�� � ��#�����5��K�8H�H�I�8�:�A�� � ��#�����3�c�+�6F�F�G�8�:�A�� � ��#�����3�c�+�6F�F�G�8�:�A�� � ��#���f�f�U�$:�c�%�/�/�BS�>T�$U�V���6�6�%����6�*�+�{�:�����t�c�+�&6�6�7�9U�V�A�� � ��#�����6��[�9I�I�J�.�0�A�� � ��#�����5��K�8H�H�I�8�:�A�� � ��#�����3�c�+�6F�F�G�8�:�A�� � ��#�����3�c�+�6F�F�G�8�:�A�� � ��#�G#$�J�rc���tjd�}|j|�}i}g|d<|D]2}t|d�dkDr|d|d<|dj	|d��4|S)zzReturn separate ACE of an ACL

    :param acl: A string representing the ACL
    :return: A hash with different parts
    z(\w+)?(\(.*?\))�acesr�flags�)�re�compile�findall�lenrW)�acl�p�tab�hash�es     r�
chunck_aclrm8sv��	�
�
�%�&�A�
�)�)�C�.�C�
�D��D��L�
�"���q��t�9�q�=��a�D�D��M��V����A�a�D�!�"�
�Krc���tjd�}|j|�}i}|D]C}|ddk(r|d|d<|ddk(r|d|d<|ddk(r|d|d	<|dd
k(s�<|d|d<�E|S)z� Return separate parts of the SDDL (owner, group, ...)

    :param sddl: An string containing the SDDL to chunk
    :return: A hash with the different chunk
    z([OGDS]:)(.*?)(?=(?:[GDS]:|$))rzO:rc�ownerzG:�groupzD:�daclzS:�sacl)rdrerf)rrirjrkrls     r�chunck_sddlrsLs���	�
�
�4�5�A�
�)�)�D�/�C�
�D�
� ���Q�4�4�<��a�D�D��M��Q�4�4�<��a�D�D��M��Q�4�4�<��Q�4�D��L��Q�4�4�<��Q�4�D��L� ��Krc�~�tj�}|j|_|j|_|j|_|j
|_g}|j�|jj}tdt|��D]6}||}|jtjzr�&|j|��8g}|j�|jj}tdt|��D]6}||}|jtjzr�&|j|��8|S)zvGet the SD without any inherited ACEs

    :param sd: SD to strip
    :return: An SD with inherited ACEs stripped
    r)rr
�	owner_sid�	group_sid�type�revisionrrra�rangergrb�SEC_ACE_FLAG_INHERITED_ACE�sacl_addrq�dacl_add)�sd�sd_cleanra�i�aces     r�get_clean_sdr�ds���"�"�$�H����H�����H���G�G�H�M����H��
�D�	�w�w���w�w�|�|��
�1�c�$�i�
 ����1�g���y�y�8�>�>�>����c�"����D�	�w�w���w�w�|�|��
�1�c�$�i�
 ����1�g���y�y�8�>�>�>����c�"����Orc���t|�j|�}t|�j|�}d}t|�}t|�}	d|vrd}nd|	vr|d|	dk7rd|	d�d|d�d�}d|vrd|z}n d|	vr|d|	dk7r|�d	|	d�d|d�d�}d
g}
|r|
jd�|
D�](}||vr�||	vr�t	�}t	�}
t||�}t|	|�}|dD]}|j
|��|dD]}|
j
|��t	|
�D])}||vs�|j|�|
j|��+t|�t|
�zd
kDs��|dk(rt|
�d
k(r|ry|�d|�d�}|D]
}|�d|�d�}�|
D]
}|�d|�d�}���||vr||	vr
|�d|�d�}��||vs��||	vs��!|�d|�d�}��+|S)a~Get the difference between 2 sd

    This function split the textual representation of ACL into smaller
    chunk in order to not to report a simple permutation as a difference

    :param refsddl: First sddl to compare
    :param cursddl: Second sddl to compare
    :param checkSacl: If false we skip the sacl checks
    :return: A string that explain difference between sddls
    rroz	No owner in current SDz	Owner mismatch: z
 (in ref) z
(in current)
rpz%s	No group in current SDz	Group mismatch: rqrrrarz	Part z@ is different between reference and current here is the detail:
z		z% ACE is not present in the reference
z# ACE is not present in the current
z	Reference ACL hasn't a z part
z	Current ACL hasn't a )	r��as_sddlrsrW�setrm�add�removerg)�refsd�cursd�	domainsid�	checkSacl�ignoreAdditionalACEs�cursddl�refsddl�txt�hash_cur�hash_ref�parts�part�h_cur�h_ref�c_cur�c_ref�elem�k�items                   r�get_diff_sdsr��sS���5�!�)�)�)�4�G��5�!�)�)�)�4�G�
�C��7�#�H��7�#�H��h��(��	�H�	��'�!2�h�w�6G�!G�"*�7�"3�X�g�5F�H���h��*�S�0��	�H�	��'�!2�h�w�6G�!G�"%�x��'8�(�7�:K�M���H�E��
���V���'E���8���� 0��E�E��E�E��x��~�.�E��x��~�.�E��f�
�
 ���	�	�$��
 ��f�
�
 ���	�	�$��
 ���Z�
$����:��L�L��O��L�L��O�
$�
�5�z�C��J�&��*��"�9��U��q��+�!�?B�4�I��"�7�D�,/��7�C�7�"�5�D�*-�t�5�C�5��X�
�$�h�"6�<?��F�C�
��
!�d�h�&6�:=�t�D�C�O'E�R�Jr)N)TF)%�__doc__�samba.dcerpcr�	samba.ndrr�samba.schemarrMrdrrrrr r"r$r&r)r+r-r/r1r3r5r7r9r;r=r?rArCrEr_rmrsr�r��rr�<module>r�s���6M�!��.�
�	�
�3�3�3�,3�*3�$3�3�3�3�<3�~
3�=3�@3�"
3� 3�3�3�3�;3�|3�	3�3�H�V�(�0 �F59�&+�Lr

Zerion Mini Shell 1.0