def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\schtasks.exe"),
            " /Change " in event.deep_get("CommandLine", default=""),
            " /TN " in event.deep_get("CommandLine", default=""),
            any(
                [
                    "\\AppData\\Local\\Temp" in event.deep_get("CommandLine", default=""),
                    "\\AppData\\Roaming\\" in event.deep_get("CommandLine", default=""),
                    "\\Users\\Public\\" in event.deep_get("CommandLine", default=""),
                    "\\WINDOWS\\Temp\\" in event.deep_get("CommandLine", default=""),
                    "\\Desktop\\" in event.deep_get("CommandLine", default=""),
                    "\\Downloads\\" in event.deep_get("CommandLine", default=""),
                    "\\Temporary Internet" in event.deep_get("CommandLine", default=""),
                    "C:\\ProgramData\\" in event.deep_get("CommandLine", default=""),
                    "C:\\Perflogs\\" in event.deep_get("CommandLine", default=""),
                    "%ProgramData%" in event.deep_get("CommandLine", default=""),
                    "%appdata%" in event.deep_get("CommandLine", default=""),
                    "%comspec%" in event.deep_get("CommandLine", default=""),
                    "%localappdata%" in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "regsvr32" in event.deep_get("CommandLine", default=""),
                    "rundll32" in event.deep_get("CommandLine", default=""),
                    "cmd /c " in event.deep_get("CommandLine", default=""),
                    "cmd /k " in event.deep_get("CommandLine", default=""),
                    "cmd /r " in event.deep_get("CommandLine", default=""),
                    "cmd.exe /c " in event.deep_get("CommandLine", default=""),
                    "cmd.exe /k " in event.deep_get("CommandLine", default=""),
                    "cmd.exe /r " in event.deep_get("CommandLine", default=""),
                    "powershell" in event.deep_get("CommandLine", default=""),
                    "mshta" in event.deep_get("CommandLine", default=""),
                    "wscript" in event.deep_get("CommandLine", default=""),
                    "cscript" in event.deep_get("CommandLine", default=""),
                    "certutil" in event.deep_get("CommandLine", default=""),
                    "bitsadmin" in event.deep_get("CommandLine", default=""),
                    "bash.exe" in event.deep_get("CommandLine", default=""),
                    "bash " in event.deep_get("CommandLine", default=""),
                    "scrcons" in event.deep_get("CommandLine", default=""),
                    "wmic " in event.deep_get("CommandLine", default=""),
                    "wmic.exe" in event.deep_get("CommandLine", default=""),
                    "forfiles" in event.deep_get("CommandLine", default=""),
                    "scriptrunner" in event.deep_get("CommandLine", default=""),
                    "hh.exe" in event.deep_get("CommandLine", default=""),
                    "hh " in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
