Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh: obscure keystroke interval timing #24

Closed
wants to merge 2 commits into from

Conversation

djmdjm
Copy link
Owner

@djmdjm djmdjm commented Aug 11, 2023

This implements some obscurity for keystroke timings in the ssh client. It is intended to frustrate basic inter-keystroke measurements by an adversary who can passively observe ciphertext packets.

The basic idea is twofold:

  1. When it looks like the connection is in a keystroke-interactive mode, determined by small amounts of data in the output buffer, then start sending packets on a fixed schedule (64ms by default) rather than as soon as possible..
  2. When no packet was sent in a schedule interval, send a chaff packet to mask the absence of a keystroke. Keep doing this for some random interval since the last keystroke.

Chaff packets are sent using a new transport-level SSH2_MSG_PING extension, as nothing else lets us send a message that will elicit a reply, with a size that exactly matches a single keystroke. Currently this message uses an implementation-local message number, but I wrote an ID to see if it can be standardised.

clientloop.c Outdated Show resolved Hide resolved
@djmdjm djmdjm changed the title WIP: timing attack mitigation for the client ssh: obscure keystroke interval timing Aug 22, 2023
This adds a pair of transport messages SSH2_MSG_PING/PONG to implement
a protocol-level ping capability.
Quantises packet output times at the client for interactive connections
when there is only a keystroke or two in the output buffer.

Send chaff packets on intervals were no keystroke was observed.

Controlled by a new ssh_config:ObscureKeystrokeTiming keyword
@djmdjm djmdjm closed this Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant