哪个 ssh 漏洞通过在进程中间更改用户名来工作?

信息安全 SSH 已知漏洞 打开sh 日志分析
2021-09-08 20:36:53

每隔几个小时,我就会在我的服务器日志中看到其中的一些:

sshd[...]: Disconnecting: Change of username or service not allowed: (httpd,ssh-connection) -> (http,ssh-connection) [preauth]
sshd[...]: Disconnecting: Change of username or service not allowed: (identd,ssh-connection) -> (ident,ssh-connection) [preauth]
sshd[...]: Disconnecting: Change of username or service not allowed: (administrator,ssh-connection) -> (admin,ssh-connection) [preauth]
sshd[...]: Disconnecting: Change of username or service not allowed: (admins,ssh-connection) -> (admin,ssh-connection) [preauth]
sshd[...]: Disconnecting: Change of username or service not allowed: (admissions,ssh-connection) -> (adm,ssh-connection) [preauth]

...other attempts of the same kind: tony -> to, users -> user, wwwrun -> www, ...

显然,有人试图混淆我的 ssh 守护进程,首先将自己标识为foo然后再标识为somePrefixOfFoo(显然没有成功)。

SSH 中是否存在或是否存在允许此类攻击成功的特定漏洞?

1个回答

我不认为,这有任何漏洞,至少在openssh. 导致此错误的代码已添加到此提交中,它引用了来自ietf-drafts. 可能是 RFC4252,今天声明:

在每次新的身份验证尝试中都会重复“用户名”和“服务名”,并且可能会更改。服务器实现必须在每条消息中仔细检查它们,如果它们发生变化,必须刷新任何累积的身份验证状态。如果无法刷新身份验证状态,则必须在“用户名”或“服务名”更改时断开连接。

所以我相信这是突出的案例。