def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\reg.exe"),
            " query " in event.deep_get("CommandLine", default=""),
            "/t " in event.deep_get("CommandLine", default=""),
            "REG_SZ" in event.deep_get("CommandLine", default=""),
            "/s" in event.deep_get("CommandLine", default=""),
            any(
                [
                    all(
                        [
                            "/f " in event.deep_get("CommandLine", default=""),
                            "HKLM" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            "/f " in event.deep_get("CommandLine", default=""),
                            "HKCU" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    "HKCU\\Software\\SimonTatham\\PuTTY\\Sessions"
                    in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
