def rule(event):
    if all(
        [
            any(
                [
                    "\\SOFTWARE\\Microsoft\\Cryptography\\Providers\\"
                    in event.deep_get("TargetObject", default=""),
                    "\\SOFTWARE\\Microsoft\\Cryptography\\OID\\EncodingType"
                    in event.deep_get("TargetObject", default=""),
                    "\\SOFTWARE\\WOW6432Node\\Microsoft\\Cryptography\\Providers\\"
                    in event.deep_get("TargetObject", default=""),
                    "\\SOFTWARE\\WOW6432Node\\Microsoft\\Cryptography\\OID\\EncodingType"
                    in event.deep_get("TargetObject", default=""),
                ]
            ),
            any(
                [
                    "\\Dll" in event.deep_get("TargetObject", default=""),
                    "\\$DLL" in event.deep_get("TargetObject", default=""),
                ]
            ),
            not any(
                [
                    event.deep_get("Details", default="") in ["WINTRUST.DLL", "mso.dll"],
                    all(
                        [
                            event.deep_get("Image", default="")
                            == "C:\\Windows\\System32\\poqexec.exe",
                            "\\CryptSIPDll" in event.deep_get("TargetObject", default=""),
                            event.deep_get("Details", default="")
                            == "C:\\Windows\\System32\\PsfSip.dll",
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
