def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\wbem\\WmiPrvSE.exe"),
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\certutil.exe"),
                            event.deep_get("Image", default="").endswith("\\cscript.exe"),
                            event.deep_get("Image", default="").endswith("\\mshta.exe"),
                            event.deep_get("Image", default="").endswith("\\msiexec.exe"),
                            event.deep_get("Image", default="").endswith("\\regsvr32.exe"),
                            event.deep_get("Image", default="").endswith("\\rundll32.exe"),
                            event.deep_get("Image", default="").endswith("\\verclsid.exe"),
                            event.deep_get("Image", default="").endswith("\\wscript.exe"),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\cmd.exe"),
                            any(
                                [
                                    "cscript" in event.deep_get("CommandLine", default=""),
                                    "mshta" in event.deep_get("CommandLine", default=""),
                                    "powershell" in event.deep_get("CommandLine", default=""),
                                    "pwsh" in event.deep_get("CommandLine", default=""),
                                    "regsvr32" in event.deep_get("CommandLine", default=""),
                                    "rundll32" in event.deep_get("CommandLine", default=""),
                                    "wscript" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="").endswith("\\WerFault.exe"),
                    event.deep_get("Image", default="").endswith("\\WmiPrvSE.exe"),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\msiexec.exe"),
                            "/i " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
