def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\cmd.exe"),
                    event.deep_get("OriginalFileName", default="") == "Cmd.Exe",
                ]
            ),
            any(
                [
                    any(
                        [
                            ">?%APPDATA%\\" in event.deep_get("CommandLine", default=""),
                            ">?%TEMP%\\" in event.deep_get("CommandLine", default=""),
                            ">?%TMP%\\" in event.deep_get("CommandLine", default=""),
                            ">?%USERPROFILE%\\" in event.deep_get("CommandLine", default=""),
                            ">?C:\\ProgramData\\" in event.deep_get("CommandLine", default=""),
                            ">?C:\\Temp\\" in event.deep_get("CommandLine", default=""),
                            ">?C:\\Users\\Public\\" in event.deep_get("CommandLine", default=""),
                            ">?C:\\Windows\\Temp\\" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    " >" in event.deep_get("CommandLine", default=""),
                                    '">' in event.deep_get("CommandLine", default=""),
                                    "'>" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                            "C:\\Users\\" in event.deep_get("CommandLine", default=""),
                            "\\AppData\\Local\\" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
