import re


def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\appcmd.exe"),
                    event.deep_get("OriginalFileName", default="") == "appcmd.exe",
                ]
            ),
            "list " in event.deep_get("CommandLine", default=""),
            any(
                [
                    any(
                        [
                            " /config" in event.deep_get("CommandLine", default=""),
                            " /xml" in event.deep_get("CommandLine", default=""),
                            " -config" in event.deep_get("CommandLine", default=""),
                            " -xml" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    " /@t" in event.deep_get("CommandLine", default=""),
                                    " /text" in event.deep_get("CommandLine", default=""),
                                    " /show" in event.deep_get("CommandLine", default=""),
                                    " -@t" in event.deep_get("CommandLine", default=""),
                                    " -text" in event.deep_get("CommandLine", default=""),
                                    " -show" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                            any(
                                [
                                    re.match(
                                        r"^.*:\\.*.*$", event.deep_get("CommandLine", default="")
                                    ),
                                    "password" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
