def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 4697,
            any(
                [
                    all(
                        [
                            "/c" in event.deep_get("ServiceFileName", default=""),
                            "echo" in event.deep_get("ServiceFileName", default=""),
                            "\\pipe\\" in event.deep_get("ServiceFileName", default=""),
                            any(
                                [
                                    "cmd" in event.deep_get("ServiceFileName", default=""),
                                    "%COMSPEC%" in event.deep_get("ServiceFileName", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            "rundll32" in event.deep_get("ServiceFileName", default=""),
                            ".dll,a" in event.deep_get("ServiceFileName", default=""),
                            "/p:" in event.deep_get("ServiceFileName", default=""),
                        ]
                    ),
                    event.deep_get("ServiceFileName", default="").startswith(
                        "\\\\127.0.0.1\\ADMIN$\\"
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
