def rule(event):
    if any(
        [
            any(
                [
                    all(
                        [
                            "sc " in event.deep_get("CommandLine", default=""),
                            "config " in event.deep_get("CommandLine", default=""),
                            "binpath=" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            "sc " in event.deep_get("CommandLine", default=""),
                            "failure" in event.deep_get("CommandLine", default=""),
                            "command=" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            all(
                [
                    any(
                        [
                            all(
                                [
                                    "reg " in event.deep_get("CommandLine", default=""),
                                    "add " in event.deep_get("CommandLine", default=""),
                                    "FailureCommand" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                            all(
                                [
                                    "reg " in event.deep_get("CommandLine", default=""),
                                    "add " in event.deep_get("CommandLine", default=""),
                                    "ImagePath" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                    any(
                        [
                            ".sh" in event.deep_get("CommandLine", default=""),
                            ".exe" in event.deep_get("CommandLine", default=""),
                            ".dll" in event.deep_get("CommandLine", default=""),
                            ".bin$" in event.deep_get("CommandLine", default=""),
                            ".bat" in event.deep_get("CommandLine", default=""),
                            ".cmd" in event.deep_get("CommandLine", default=""),
                            ".js" in event.deep_get("CommandLine", default=""),
                            ".msh$" in event.deep_get("CommandLine", default=""),
                            ".reg$" in event.deep_get("CommandLine", default=""),
                            ".scr" in event.deep_get("CommandLine", default=""),
                            ".ps" in event.deep_get("CommandLine", default=""),
                            ".vb" in event.deep_get("CommandLine", default=""),
                            ".jar" in event.deep_get("CommandLine", default=""),
                            ".pl" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
