使用 CVE-2018-10933 无需任何凭据即可获取 shell
libSSH 关于 CVE-2018-10933 的信息:https://www.libssh.org/security/advisories/CVE-2018-10933.txt
libSSH 的漏洞修复版本:https://www.libssh.org/2018/10/16/libssh-0-8-4-and-0-7-6-security-and-bugfix-release/
https://gist.github.com/0x4D31/35ddb0322530414bbb4c3288292749cc
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
重要提示 : "试图复现 libssh 漏洞的人:示例代码(samplesshd-cb)不存在漏洞,因为它带有显式认证处理器。你可以打开一个通道,但不会发生任何事情。"
正如我们所见,此部分仅用于打开通道。你无法在由 "samplesshd-cb" 运行的服务器上获取 shell。
它仅用于打开通道。我编写的 PoC 仅适用于远程主机。
下载、解压并构建存在漏洞的 libSSH 版本:https://www.libssh.org/files/0.7/libssh-0.7.4.tar.xz
然后在您自己的服务器上通过 ssh 编译并运行 libSSH。
PWD: /libssh-0.7.4/build/examples/samplesshd-cb
./samplesshd-cb --dsakey==yourdsakey 127.0.0.1 --port=2222
如果你已有伪造的 SSH 密钥,请使用第二个工具 bypasswithfakekey.py
pip install -r requirements.txt
If paramiko==2.0.8 doesn't works try : pip install paramiko==2.4.2
python libsshauthbypass.py --help
python bypasswithfakekey.py --help
