def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("ParentImage", default="").endswith("\\wscript.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\cscript.exe"),
                ]
            ),
            any(
                [
                    event.deep_get("Image", default="").endswith("\\rundll32.exe"),
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith("\\cmd.exe"),
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                                ]
                            ),
                            any(
                                [
                                    all(
                                        [
                                            "mshta" in event.deep_get("CommandLine", default=""),
                                            "http" in event.deep_get("CommandLine", default=""),
                                        ]
                                    ),
                                    any(
                                        [
                                            "rundll32" in event.deep_get("CommandLine", default=""),
                                            "regsvr32" in event.deep_get("CommandLine", default=""),
                                            "msiexec" in event.deep_get("CommandLine", default=""),
                                        ]
                                    ),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
            not all(
                [
                    event.deep_get("Image", default="").endswith("\\rundll32.exe"),
                    any(
                        [
                            "UpdatePerUserSystemParameters"
                            in event.deep_get("CommandLine", default=""),
                            "PrintUIEntry" in event.deep_get("CommandLine", default=""),
                            "ClearMyTracksByProcess" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
