def rule(event):
    if any(
        [
            "Get-Keystrokes" in event.deep_get("ScriptBlockText", default=""),
            all(
                [
                    "Get-ProcAddress user32.dll GetAsyncKeyState"
                    in event.deep_get("ScriptBlockText", default=""),
                    "Get-ProcAddress user32.dll GetForegroundWindow"
                    in event.deep_get("ScriptBlockText", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
