def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\cmd.exe"),
            event.deep_get("ParentCommandLine", default="").endswith(".bat"),
            any(
                [
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\xcopy.exe"),
                            "powershell.exe" in event.deep_get("CommandLine", default=""),
                            ".bat.exe" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\xcopy.exe"),
                            "pwsh.exe" in event.deep_get("CommandLine", default=""),
                            ".bat.exe" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\attrib.exe"),
                            "+s" in event.deep_get("CommandLine", default=""),
                            "+h" in event.deep_get("CommandLine", default=""),
                            ".bat.exe" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
