def rule(event):
    if any(
        [
            all(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\bash.exe"),
                            event.deep_get("Image", default="").endswith("\\cmd.exe"),
                            event.deep_get("Image", default="").endswith("\\cscript.exe"),
                            event.deep_get("Image", default="").endswith("\\msbuild.exe"),
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                            event.deep_get("Image", default="").endswith("\\sh.exe"),
                            event.deep_get("Image", default="").endswith("\\wscript.exe"),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("TargetFilename", default="").startswith(
                                "C:\\PerfLogs\\"
                            ),
                            event.deep_get("TargetFilename", default="").startswith(
                                "C:\\Users\\Public\\"
                            ),
                        ]
                    ),
                ]
            ),
            all(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\certutil.exe"),
                            event.deep_get("Image", default="").endswith("\\forfiles.exe"),
                            event.deep_get("Image", default="").endswith("\\mshta.exe"),
                            event.deep_get("Image", default="").endswith("\\schtasks.exe"),
                            event.deep_get("Image", default="").endswith("\\scriptrunner.exe"),
                            event.deep_get("Image", default="").endswith("\\wmic.exe"),
                        ]
                    ),
                    any(
                        [
                            "C:\\PerfLogs\\" in event.deep_get("TargetFilename", default=""),
                            "C:\\Users\\Public\\" in event.deep_get("TargetFilename", default=""),
                            "C:\\Windows\\Temp\\" in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
