def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\mofcomp.exe"),
                    event.deep_get("OriginalFileName", default="") == "mofcomp.exe",
                ]
            ),
            any(
                [
                    any(
                        [
                            event.deep_get("ParentImage", default="").endswith("\\cmd.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\powershell.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\pwsh.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\wsl.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\wscript.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\cscript.exe"),
                        ]
                    ),
                    any(
                        [
                            "\\AppData\\Local\\Temp" in event.deep_get("CommandLine", default=""),
                            "\\Users\\Public\\" in event.deep_get("CommandLine", default=""),
                            "\\WINDOWS\\Temp\\" in event.deep_get("CommandLine", default=""),
                            "%temp%" in event.deep_get("CommandLine", default=""),
                            "%tmp%" in event.deep_get("CommandLine", default=""),
                            "%appdata%" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            not all(
                [
                    event.deep_get("ParentImage", default="")
                    == "C:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
                    "C:\\Windows\\TEMP\\" in event.deep_get("CommandLine", default=""),
                    event.deep_get("CommandLine", default="").endswith(".mof"),
                ]
            ),
            not all(
                [
                    "C:\\Windows\\TEMP\\" in event.deep_get("CommandLine", default=""),
                    event.deep_get("CommandLine", default="").endswith(".mof"),
                ]
            ),
        ]
    ):
        return True
    return False
