def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\onenote.exe"),
                    event.deep_get("Image", default="").endswith("\\onenotem.exe"),
                    event.deep_get("Image", default="").endswith("\\onenoteim.exe"),
                ]
            ),
            "\\AppData\\Local\\Temp\\OneNote\\" in event.deep_get("TargetFilename", default=""),
            any(
                [
                    event.deep_get("TargetFilename", default="").endswith(".bat"),
                    event.deep_get("TargetFilename", default="").endswith(".chm"),
                    event.deep_get("TargetFilename", default="").endswith(".cmd"),
                    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(".htm"),
                    event.deep_get("TargetFilename", default="").endswith(".html"),
                    event.deep_get("TargetFilename", default="").endswith(".js"),
                    event.deep_get("TargetFilename", default="").endswith(".lnk"),
                    event.deep_get("TargetFilename", default="").endswith(".ps1"),
                    event.deep_get("TargetFilename", default="").endswith(".vbe"),
                    event.deep_get("TargetFilename", default="").endswith(".vbs"),
                    event.deep_get("TargetFilename", default="").endswith(".wsf"),
                ]
            ),
        ]
    ):
        return True
    return False
