OpenSSH に MaxAuthTries をバイパスできる脆弱性[Security]

このエントリーをはてなブックマークに追加


2015-07-22




パスワードの総当りアタックが大変捗ります、という攻撃手法が見つかってしまったようです。

念のためこの攻撃が成功するか確認してみました。上記サイトにも書いてあるんですが、この攻撃が成功する前提として、 keyboard-interactive authentication が許可されてないとダメというのがあります。

具体的には /etc/ssh/sshd_config に

PasswordAuthentication yes
ChallengeResponseAuthentication yes


となっているときに、攻撃が成功するというものです。FreeBSD は ChallengeResponseAuthentication が標準で yes になっているので、標的となる可能性が高いようですが、CentOS/RHEL系は、ChallengeResponseAuthentication が標準で no なので、この攻撃は成功しないようです。

ということで、念のためサーバ設定を確認しておくことをお勧めします。一番はパスワード認証を許可しないことですね。もちろん

PasswordAuthentication no
ChallengeResponseAuthentication no


にする前に、公開鍵認証でログインできるようにしておかないと、ログインできなくなっちゃいますけど。

[追記]:

KbdInteractiveAuthentication
    Specifies whether to allow keyboard-interactive authentication. The argument
    to this keyword must be “yes” or “no”. The default is to use whatever value
    ChallengeResponseAuthentication is set to (by default “yes”).


KbdInteractiveAuthentication が個別に設定されている例もあるかも?

ChallengeResponseAuthentication no
KbdInteractiveAuthentication yes


では影響を受けず、

ChallengeResponseAuthentication yes
KbdInteractiveAuthentication no


なら、影響を受けるようです(結局 ChallengeResponseAuthentication 次第? KbdInteractiveAuthentication の存在意義は……)

Reddit についてるコメントも参考になりますね。

OpenSSH keyboard-interactive authentication brute force vulnerability (MaxAuthTries bypass)
http://www.reddit.com/r/netsec/comments/3dnzcq/openssh_keyboardinteractive_authentication_brute/

[追記その2]:

1つ指摘頂きました。



もうちょっと噛み砕いた情報が欲しい場合は、ozumaさんの

sshによるユーザ列挙攻撃"osueta"
http://d.hatena.ne.jp/ozuma/20140623/1403532516

内の、"ちょっと脱線:UsePAMとPasswordAuthentication" の部分が参考になります。

つまりは

ChallengeResponseAuthentication yes


の場合でも、UsePAM が no であれば、同じパスワードでのログイン不可となるので、攻撃に成功しないよということになります。より具体的には、ozumaさんが表にまとめられている通り、下記の3つのケースで成功しません。

PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no


PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes


PasswordAuthentication no
ChallengeResponseAuthentication yes
UsePAM no


Also see: sshd_config(5)



IPv4/IPv6 meter
検索キーワードは複数指定できます
ChangeLogを検索
Google
Web www.kunitake.org
思ったより安い……時もある、Amazon

カテゴリ