2.2.12 SSH

The SSH preprocessor detects the following exploits: Challenge-Response Buffer Overflow, CRC 32, Secure CRT, and the Protocol Mismatch exploit.

Both Challenge-Response Overflow and CRC 32 attacks occur after the key exchange, and are therefore encrypted. Both attacks involve sending a large payload (20kb+) to the server immediately after the authentication challenge. To detect the attacks, the SSH preprocessor counts the number of bytes transmitted to the server. If those bytes exceed a predefined limit within a predefined number of packets, an alert is generated. Since the Challenge-Response Overflow only effects SSHv2 and CRC 32 only effects SSHv1, the SSH version string exchange is used to distinguish the attacks.

The Secure CRT and protocol mismatch exploits are observable before the key exchange.

2.2.12.1 Configuration

By default, all alerts are disabled and the preprocessor checks traffic on port 22.

The available configuration options are described below.

<#18594#><#18591#><#18591#> <#6363#>107.<#6363#> <#18594#>
server_ports #tex2html_wrap_inline6845#port#tex2html_wrap_inline6847#port#tex2html_wrap_inline6849#

This option specifies which ports the SSH preprocessor should inspect traffic to.

<#18595#><#18591#><#18591#> <#6363#>108.<#6363#> <#18595#>
max_encrypted_packets #tex2html_wrap_inline6851# number #tex2html_wrap_inline6853#

The number of stream reassembled encrypted packets that Snort will inspect before ignoring a given SSH session. The SSH vulnerabilities that Snort can detect all happen at the very beginning of an SSH session. Once max_encrypted_packets packets have been seen, Snort ignores the session to increase performance. The default is set to 25. This value can be set from 0 to 65535.

<#18596#><#18591#><#18591#> <#6363#>109.<#6363#> <#18596#>
max_client_bytes #tex2html_wrap_inline6855# number #tex2html_wrap_inline6857#

The number of unanswered bytes allowed to be transferred before alerting on Challenge-Response Overflow or CRC 32. This number must be hit before max_encrypted_packets packets are sent, or else Snort will ignore the traffic. The default is set to 19600. This value can be set from 0 to 65535.

<#18597#><#18591#><#18591#> <#6363#>110.<#6363#> <#18597#>
max_server_version_len #tex2html_wrap_inline6859# number #tex2html_wrap_inline6861#

The maximum number of bytes allowed in the SSH server version string before alerting on the Secure CRT server version string overflow. The default is set to 80. This value can be set from 0 to 255.

<#18598#><#18591#><#18591#> <#6363#>111.<#6363#> <#18598#>
autodetect

Attempt to automatically detect SSH.

<#18599#><#18591#><#18591#> <#6363#>112.<#6363#> <#18599#>
enable_respoverflow

Enables checking for the Challenge-Response Overflow exploit.

<#18600#><#18591#><#18591#> <#6363#>113.<#6363#> <#18600#>
enable_ssh1crc32

Enables checking for the CRC 32 exploit.

<#18601#><#18591#><#18591#> <#6363#>114.<#6363#> <#18601#>
enable_srvoverflow

Enables checking for the Secure CRT exploit.

<#18602#><#18591#><#18591#> <#6363#>115.<#6363#> <#18602#>
enable_protomismatch

Enables checking for the Protocol Mismatch exploit.

<#18603#><#18591#><#18591#> <#6363#>116.<#6363#> <#18603#>
enable_badmsgdir

Enable alerts for traffic flowing the wrong direction. For instance, if the presumed server generates client traffic, or if a client generates server traffic.

<#18604#><#18591#><#18591#> <#6363#>117.<#6363#> <#18604#>
enable_paysize

Enables alerts for invalid payload sizes.

<#18605#><#18591#><#18591#> <#6363#>118.<#6363#> <#18605#>
enable_recognition

Enable alerts for non-SSH traffic on SSH ports.

The SSH preprocessor should work by default. After max_encrypted_packets is reached, the preprocessor will stop processing traffic for a given session. If Challenge-Response Overflow or CRC 32 false positive, try increasing the number of required client bytes with max_client_bytes.

2.2.12.2 Example Configuration from snort.conf

Looks for attacks on SSH server port 22. Alerts at 19600 unacknowledged bytes within 20 encrypted packets for the Challenge-Response Overflow/CRC32 exploits.

verbatim314#