def rule(event):
    if all(
        [
            any(
                [
                    "\\CurrentControlSet\\Services\\NTDS\\DirectoryServiceExtPt"
                    in event.deep_get("TargetObject", default=""),
                    "\\CurrentControlSet\\Services\\NTDS\\LsaDbExtPt"
                    in event.deep_get("TargetObject", default=""),
                ]
            ),
            not all(
                [
                    event.deep_get("Image", default="") == "C:\\Windows\\system32\\lsass.exe",
                    event.deep_get("Details", default="")
                    in [
                        "%%systemroot%%\\system32\\ntdsa.dll",
                        "%%systemroot%%\\system32\\lsadb.dll",
                    ],
                ]
            ),
        ]
    ):
        return True
    return False
