def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("ParentImage", default="").endswith("\\caddy.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\httpd.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\nginx.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\php-cgi.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\w3wp.exe"),
                            event.deep_get("ParentImage", default="").endswith(
                                "\\ws_tomcatservice.exe"
                            ),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    event.deep_get("ParentImage", default="").endswith(
                                        "\\java.exe"
                                    ),
                                    event.deep_get("ParentImage", default="").endswith(
                                        "\\javaw.exe"
                                    ),
                                ]
                            ),
                            any(
                                [
                                    "-tomcat-" in event.deep_get("ParentImage", default=""),
                                    "\\tomcat" in event.deep_get("ParentImage", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    event.deep_get("ParentImage", default="").endswith(
                                        "\\java.exe"
                                    ),
                                    event.deep_get("ParentImage", default="").endswith(
                                        "\\javaw.exe"
                                    ),
                                ]
                            ),
                            any(
                                [
                                    "catalina.jar" in event.deep_get("CommandLine", default=""),
                                    "CATALINA_HOME" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
            any(
                [
                    all(
                        [
                            "rundll32" in event.deep_get("CommandLine", default=""),
                            "comsvcs" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            " -hp" in event.deep_get("CommandLine", default=""),
                            " a " in event.deep_get("CommandLine", default=""),
                            " -m" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            "net" in event.deep_get("CommandLine", default=""),
                            " user " in event.deep_get("CommandLine", default=""),
                            " /add" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            "net" in event.deep_get("CommandLine", default=""),
                            " localgroup " in event.deep_get("CommandLine", default=""),
                            " administrators " in event.deep_get("CommandLine", default=""),
                            "/add" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\ntdsutil.exe"),
                            event.deep_get("Image", default="").endswith("\\ldifde.exe"),
                            event.deep_get("Image", default="").endswith("\\adfind.exe"),
                            event.deep_get("Image", default="").endswith("\\procdump.exe"),
                            event.deep_get("Image", default="").endswith("\\Nanodump.exe"),
                            event.deep_get("Image", default="").endswith("\\vssadmin.exe"),
                            event.deep_get("Image", default="").endswith("\\fsutil.exe"),
                        ]
                    ),
                    any(
                        [
                            " -decode " in event.deep_get("CommandLine", default=""),
                            " -NoP " in event.deep_get("CommandLine", default=""),
                            " -W Hidden " in event.deep_get("CommandLine", default=""),
                            " /decode " in event.deep_get("CommandLine", default=""),
                            " /ticket:" in event.deep_get("CommandLine", default=""),
                            " sekurlsa" in event.deep_get("CommandLine", default=""),
                            ".dmp full" in event.deep_get("CommandLine", default=""),
                            ".downloadfile(" in event.deep_get("CommandLine", default=""),
                            ".downloadstring(" in event.deep_get("CommandLine", default=""),
                            "FromBase64String" in event.deep_get("CommandLine", default=""),
                            "process call create" in event.deep_get("CommandLine", default=""),
                            "reg save " in event.deep_get("CommandLine", default=""),
                            "whoami /priv" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
