def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\excel.exe"),
                    event.deep_get("Image", default="").endswith("\\msaccess.exe"),
                    event.deep_get("Image", default="").endswith("\\mspub.exe"),
                    event.deep_get("Image", default="").endswith("\\powerpnt.exe"),
                    event.deep_get("Image", default="").endswith("\\visio.exe"),
                    event.deep_get("Image", default="").endswith("\\winword.exe"),
                ]
            ),
            any(
                [
                    event.deep_get("TargetFilename", default="").endswith(".bat"),
                    event.deep_get("TargetFilename", default="").endswith(".cmd"),
                    event.deep_get("TargetFilename", default="").endswith(".com"),
                    event.deep_get("TargetFilename", default="").endswith(".dll"),
                    event.deep_get("TargetFilename", default="").endswith(".exe"),
                    event.deep_get("TargetFilename", default="").endswith(".hta"),
                    event.deep_get("TargetFilename", default="").endswith(".ocx"),
                    event.deep_get("TargetFilename", default="").endswith(".proj"),
                    event.deep_get("TargetFilename", default="").endswith(".ps1"),
                    event.deep_get("TargetFilename", default="").endswith(".scf"),
                    event.deep_get("TargetFilename", default="").endswith(".scr"),
                    event.deep_get("TargetFilename", default="").endswith(".sys"),
                    event.deep_get("TargetFilename", default="").endswith(".vbe"),
                    event.deep_get("TargetFilename", default="").endswith(".vbs"),
                    event.deep_get("TargetFilename", default="").endswith(".wsf"),
                    event.deep_get("TargetFilename", default="").endswith(".wsh"),
                ]
            ),
            not all(
                [
                    "\\AppData\\Local\\assembly\\tmp\\"
                    in event.deep_get("TargetFilename", default=""),
                    event.deep_get("TargetFilename", default="").endswith(".dll"),
                ]
            ),
            not any(
                [
                    all(
                        [
                            "C:\\Users\\" in event.deep_get("TargetFilename", default=""),
                            "\\AppData\\Local\\Microsoft\\Office\\"
                            in event.deep_get("TargetFilename", default=""),
                            "\\WebServiceCache\\AllUsers"
                            in event.deep_get("TargetFilename", default=""),
                            event.deep_get("TargetFilename", default="").endswith(".com"),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\winword.exe"),
                            "\\AppData\\Local\\Temp\\webexdelta\\"
                            in event.deep_get("TargetFilename", default=""),
                            any(
                                [
                                    event.deep_get("TargetFilename", default="").endswith(".dll"),
                                    event.deep_get("TargetFilename", default="").endswith(".exe"),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            "C:\\Users\\" in event.deep_get("TargetFilename", default=""),
                            "\\AppData\\Local\\Microsoft\\Office\\"
                            in event.deep_get("TargetFilename", default=""),
                            "\\BackstageInAppNavCache\\"
                            in event.deep_get("TargetFilename", default=""),
                            event.deep_get("TargetFilename", default="").endswith(".com"),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
