def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\mshta.exe"),
                    event.deep_get("Image", default="").endswith("\\wscript.exe"),
                    event.deep_get("Image", default="").endswith("\\cscript.exe"),
                ]
            ),
            not any(
                [
                    event.deep_get("Details", default="") == "Binary Data",
                    event.deep_get("Details", default="") == "",
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\wscript.exe"),
                            any(
                                [
                                    "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Notifications\\Data\\"
                                    in event.deep_get("TargetObject", default=""),
                                    "\\Services\\bam\\State\\UserSettings\\S-1-"
                                    in event.deep_get("TargetObject", default=""),
                                    "Software\\Microsoft\\Windows Script\\Settings\\Telemetry\\wscript.exe\\"
                                    in event.deep_get("TargetObject", default=""),
                                    "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\"
                                    in event.deep_get("TargetObject", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\wscript.exe"),
                            "\\wscript.exe" in event.deep_get("TargetObject", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
