def rule(event):
    if all(
        [
            "Software\\Microsoft\\Windows\\CurrentVersion"
            in event.deep_get("TargetObject", default=""),
            any(
                [
                    "vbscript:" in event.deep_get("Details", default=""),
                    "jscript:" in event.deep_get("Details", default=""),
                    "mshtml," in event.deep_get("Details", default=""),
                    "RunHTMLApplication" in event.deep_get("Details", default=""),
                    "Execute(" in event.deep_get("Details", default=""),
                    "CreateObject" in event.deep_get("Details", default=""),
                    "window.close" in event.deep_get("Details", default=""),
                ]
            ),
            not any(
                [
                    "Software\\Microsoft\\Windows\\CurrentVersion\\Run"
                    in event.deep_get("TargetObject", default=""),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\msiexec.exe"),
                            "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\"
                            in event.deep_get("TargetObject", default=""),
                            any(
                                [
                                    "\\Microsoft.NET\\Primary Interop Assemblies\\Microsoft.mshtml.dll"
                                    in event.deep_get("Details", default=""),
                                    "<\\Microsoft.mshtml,fileVersion="
                                    in event.deep_get("Details", default=""),
                                    "_mshtml_dll_" in event.deep_get("Details", default=""),
                                    "<\\Microsoft.mshtml,culture="
                                    in event.deep_get("Details", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
