Skip to content

Set ALPN to ssh if client sends SSH Magic Bytes #4

Description

@coolaj86

Set alpn to ssh if the first bytes from the client are 53 53 48 2d 32 2e 30 (SSH-2.0)

How to Find the Magic Bytes

nc -l localhost 2222 | hexyl
ssh localhost -p 2222 -o ConnectTimeout=1s
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 53 53 48 2d 32 2e 30 2d ┊ 4f 70 65 6e 53 53 48 5f │SSH-2.0-┊OpenSSH_│
│00000010│ 39 2e 36 0d 0a          ┊                         │9.6__   ┊        │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions