{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/54367647","id":54367647,"diff_hunk":"@@ -0,0 +1,165 @@\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+require 'rex/proto/ntlm/message'\n+require 'rex/proto/http'\n+require 'metasploit/framework/credential_collection'\n+\n+class Metasploit3 < Msf::Auxiliary\n+\n+  include Msf::Auxiliary::Report\n+  include Msf::Auxiliary::AuthBrute\n+  include Msf::Auxiliary::Scanner\n+\n+  def initialize\n+    super(\n+      'Name'           => 'OWA Exchange Web Services (EWS) Login Scanner',\n+      'Description'    => %q{\n+        This module attempts to log in to the Exchange Web Services, often\n+        exposed at https://owahost/ews/, using NTLM authentication. This method\n+        is faster and simpler than traditional form-based logins.\n+      },\n+      'Author'         => 'Rich Whitcroft',\n+      'License'        => MSF_LICENSE,\n+      'DefaultOptions' => { 'SSL' => true, 'VERBOSE' => false }\n+    )\n+\n+    register_options(\n+      [\n+        OptBool.new('AUTODISCOVER', [ false, \"Automatically discover domain URI\", true ]),\n+        OptString.new('AD_DOMAIN', [ false, \"The Active Directory domain name\", nil ]),\n+        OptString.new('TARGET_URI', [ false, \"The location of the NTLM service\", nil ]),\n+        OptInt.new('RPORT', [ true, \"The target port\", 443 ]),\n+      ], self.class)\n+  end\n+\n+  def run_host(ip)\n+    cli = Rex::Proto::Http::Client.new(datastore['RHOSTS'], datastore['RPORT'], {}, datastore['SSL'], datastore['SSLVersion'], nil, '', '')\n+    cli.set_config({ 'preferred_auth' => 'NTLM' })\n+    cli.connect\n+\n+    domain = nil\n+    uri = nil\n+\n+    if datastore['AUTODISCOVER']\n+      domain, uri = autodiscover(cli)\n+      if domain and uri\n+        print_good(\"Found NTLM service at #{uri} for domain #{domain}.\")\n+      else\n+        print_error(\"Failed to autodiscover - try manually\")","path":"modules/auxiliary/scanner/http/owa_ews_login.rb","position":52,"original_position":52,"commit_id":"f735a904ff57f5c9f67a7759097c1ba428952fb7","original_commit_id":"f735a904ff57f5c9f67a7759097c1ba428952fb7","user":{"login":"void-in","id":1746697,"avatar_url":"https://avatars.githubusercontent.com/u/1746697?v=3","gravatar_id":"","url":"https://api.github.com/users/void-in","html_url":"https://github.com/void-in","followers_url":"https://api.github.com/users/void-in/followers","following_url":"https://api.github.com/users/void-in/following{/other_user}","gists_url":"https://api.github.com/users/void-in/gists{/gist_id}","starred_url":"https://api.github.com/users/void-in/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/void-in/subscriptions","organizations_url":"https://api.github.com/users/void-in/orgs","repos_url":"https://api.github.com/users/void-in/repos","events_url":"https://api.github.com/users/void-in/events{/privacy}","received_events_url":"https://api.github.com/users/void-in/received_events","type":"User","site_admin":false},"body":"If no string interpolation then single quotes are preferred. ","created_at":"2016-02-29T04:06:32Z","updated_at":"2016-02-29T04:06:32Z","html_url":"https://github.com/rapid7/metasploit-framework/pull/6616#discussion_r54367647","pull_request_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6616","_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/54367647"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/6616#discussion_r54367647"},"pull_request":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6616"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6616","id":61022367,"html_url":"https://github.com/rapid7/metasploit-framework/pull/6616","diff_url":"https://github.com/rapid7/metasploit-framework/pull/6616.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/6616.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6616","number":6616,"state":"open","locked":false,"title":"owa_ews_login module","user":{"login":"rwhitcroft","id":9545632,"avatar_url":"https://avatars.githubusercontent.com/u/9545632?v=3","gravatar_id":"","url":"https://api.github.com/users/rwhitcroft","html_url":"https://github.com/rwhitcroft","followers_url":"https://api.github.com/users/rwhitcroft/followers","following_url":"https://api.github.com/users/rwhitcroft/following{/other_user}","gists_url":"https://api.github.com/users/rwhitcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/rwhitcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwhitcroft/subscriptions","organizations_url":"https://api.github.com/users/rwhitcroft/orgs","repos_url":"https://api.github.com/users/rwhitcroft/repos","events_url":"https://api.github.com/users/rwhitcroft/events{/privacy}","received_events_url":"https://api.github.com/users/rwhitcroft/received_events","type":"User","site_admin":false},"body":"This module is for password guessing against OWA's EWS service which often exposes NTLM authentication over HTTPS. It is typically faster than the traditional form-based OWA login method.\r\n\r\nThe Rex HTTP client was modified slightly to allow for a preferred authentication method (NTLM in this case). Without this, if a service offers Basic and NTLM simultaneously, the NTLM auth will never be reached because Basic is checked first.","created_at":"2016-02-29T03:11:38Z","updated_at":"2016-02-29T04:06:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a500b02e5b2820de0dc07a004d605cf6bb4638b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6616/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6616/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/6616/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/f735a904ff57f5c9f67a7759097c1ba428952fb7","head":{"label":"rwhitcroft:owa_ews_login","ref":"owa_ews_login","sha":"f735a904ff57f5c9f67a7759097c1ba428952fb7","user":{"login":"rwhitcroft","id":9545632,"avatar_url":"https://avatars.githubusercontent.com/u/9545632?v=3","gravatar_id":"","url":"https://api.github.com/users/rwhitcroft","html_url":"https://github.com/rwhitcroft","followers_url":"https://api.github.com/users/rwhitcroft/followers","following_url":"https://api.github.com/users/rwhitcroft/following{/other_user}","gists_url":"https://api.github.com/users/rwhitcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/rwhitcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwhitcroft/subscriptions","organizations_url":"https://api.github.com/users/rwhitcroft/orgs","repos_url":"https://api.github.com/users/rwhitcroft/repos","events_url":"https://api.github.com/users/rwhitcroft/events{/privacy}","received_events_url":"https://api.github.com/users/rwhitcroft/received_events","type":"User","site_admin":false},"repo":{"id":36733963,"name":"metasploit-framework","full_name":"rwhitcroft/metasploit-framework","owner":{"login":"rwhitcroft","id":9545632,"avatar_url":"https://avatars.githubusercontent.com/u/9545632?v=3","gravatar_id":"","url":"https://api.github.com/users/rwhitcroft","html_url":"https://github.com/rwhitcroft","followers_url":"https://api.github.com/users/rwhitcroft/followers","following_url":"https://api.github.com/users/rwhitcroft/following{/other_user}","gists_url":"https://api.github.com/users/rwhitcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/rwhitcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwhitcroft/subscriptions","organizations_url":"https://api.github.com/users/rwhitcroft/orgs","repos_url":"https://api.github.com/users/rwhitcroft/repos","events_url":"https://api.github.com/users/rwhitcroft/events{/privacy}","received_events_url":"https://api.github.com/users/rwhitcroft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rwhitcroft/metasploit-framework","description":"Metasploit Framework","fork":true,"url":"https://api.github.com/repos/rwhitcroft/metasploit-framework","forks_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/forks","keys_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/events","assignees_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/merges","archive_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/releases{/id}","deployments_url":"https://api.github.com/repos/rwhitcroft/metasploit-framework/deployments","created_at":"2015-06-02T13:11:24Z","updated_at":"2016-02-25T18:14:45Z","pushed_at":"2016-02-29T03:04:51Z","git_url":"git://github.com/rwhitcroft/metasploit-framework.git","ssh_url":"git@github.com:rwhitcroft/metasploit-framework.git","clone_url":"https://github.com/rwhitcroft/metasploit-framework.git","svn_url":"https://github.com/rwhitcroft/metasploit-framework","homepage":"http://www.metasploit.com/","size":288268,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"53ff3051e18996fbf9fb8450729dc54baf6a2bc5","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-02-29T01:35:01Z","pushed_at":"2016-02-29T03:11:39Z","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":469385,"stargazers_count":5317,"watchers_count":5317,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3782,"mirror_url":null,"open_issues_count":295,"forks":3782,"open_issues":295,"watchers":5317,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6616"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/6616"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6616"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6616/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6616/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/6616/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/f735a904ff57f5c9f67a7759097c1ba428952fb7"}}}}