def rule(event):
    if any(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\SharpImpersonation.exe"),
                    event.deep_get("OriginalFileName", default="") == "SharpImpersonation.exe",
                ]
            ),
            any(
                [
                    all(
                        [
                            " user:" in event.deep_get("CommandLine", default=""),
                            " binary:" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            " user:" in event.deep_get("CommandLine", default=""),
                            " shellcode:" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            " technique:CreateProcessAsUserW"
                            in event.deep_get("CommandLine", default=""),
                            " technique:ImpersonateLoggedOnuser"
                            in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
