CVE-2018-14628: python:descriptor: add get_deletedobjects_descriptor()
authorStefan Metzmacher <metze@samba.org>
Fri, 29 Jan 2016 22:30:59 +0000 (23:30 +0100)
committerJule Anger <janger@samba.org>
Mon, 23 Oct 2023 08:37:13 +0000 (08:37 +0000)
samba-tool drs clone-dc-database was quite useful to find
the true value of nTSecurityDescriptor of the CN=Delete Objects
containers.

Only the auto inherited SACL is available via a ldap search.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13595

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3be190dcf7153e479383f7f3d29ddca43fe121b8)

python/samba/descriptor.py

index f0568dd9e8eddca8292cace7ed1a4f30fa3f25a4..4e973ce0a7cf528cfaf810cc7a6c6963d4be9908 100644 (file)
@@ -55,6 +55,16 @@ def get_empty_descriptor(domain_sid, name_map=None):
 # "get_schema_descriptor" is located in "schema.py"
 
 
+def get_deletedobjects_descriptor(domain_sid, name_map=None):
+    if name_map is None:
+        name_map = {}
+
+    sddl = "O:SYG:SYD:PAI" \
+        "(A;;RPWPCCDCLCRCWOWDSDSW;;;SY)" \
+        "(A;;RPLC;;;BA)"
+    return sddl2binary(sddl, domain_sid, name_map)
+
+
 def get_config_descriptor(domain_sid, name_map=None):
     if name_map is None:
         name_map = {}