def rule(event):
    if all(
        [
            "\\WebHelpDesk\\bin\\" in event.deep_get("ParentImage", default=""),
            any(
                [
                    event.deep_get("ParentImage", default="").endswith("\\java.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\javaw.exe"),
                ]
            ),
            "tomcat" in event.deep_get("ParentCommandLine", default=""),
            any(
                [
                    "-enc" in event.deep_get("CommandLine", default=""),
                    "base64" in event.deep_get("CommandLine", default=""),
                    "bitsadmin" in event.deep_get("CommandLine", default=""),
                    "certutil" in event.deep_get("CommandLine", default=""),
                    "curl" in event.deep_get("CommandLine", default=""),
                    "Invoke-RestMethod" in event.deep_get("CommandLine", default=""),
                    "Invoke-WebRequest" in event.deep_get("CommandLine", default=""),
                    "irm " in event.deep_get("CommandLine", default=""),
                    "iwr " in event.deep_get("CommandLine", default=""),
                    "mshta" in event.deep_get("CommandLine", default=""),
                    "msiexec" in event.deep_get("CommandLine", default=""),
                    "Net.WebClient" in event.deep_get("CommandLine", default=""),
                    "Start-BitsTransfer" in event.deep_get("CommandLine", default=""),
                    "wget" in event.deep_get("CommandLine", default=""),
                    "wmic" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
