def rule(event):
    if all(
        [
            "$env:APPDATA" in event.deep_get("ScriptBlockText", default=""),
            "function MainPayload" in event.deep_get("ScriptBlockText", default=""),
            "::WriteAllBytes" in event.deep_get("ScriptBlockText", default=""),
            "wscript.exe" in event.deep_get("ScriptBlockText", default=""),
        ]
    ):
        return True
    return False
