def rule(event):
    if all(
        [
            any(
                [
                    "\\System\\CurrentControlSet\\Services"
                    in event.deep_get("TargetObject", default=""),
                    all(
                        [
                            "\\System\\ControlSet" in event.deep_get("TargetObject", default=""),
                            "\\Services" in event.deep_get("TargetObject", default=""),
                        ]
                    ),
                ]
            ),
            any(
                [
                    all(
                        [
                            "ADMIN$" in event.deep_get("Details", default=""),
                            ".exe" in event.deep_get("Details", default=""),
                        ]
                    ),
                    all(
                        [
                            "%COMSPEC%" in event.deep_get("Details", default=""),
                            "start" in event.deep_get("Details", default=""),
                            "powershell" in event.deep_get("Details", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
