{"action":"closed","number":7251,"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7251","id":83144920,"html_url":"https://github.com/rapid7/metasploit-framework/pull/7251","diff_url":"https://github.com/rapid7/metasploit-framework/pull/7251.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/7251.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7251","number":7251,"state":"closed","locked":false,"title":"Added code to assign CPORT value to the parent scanner object","user":{"login":"bwatters-r7","id":17987018,"avatar_url":"https://avatars.githubusercontent.com/u/17987018?v=3","gravatar_id":"","url":"https://api.github.com/users/bwatters-r7","html_url":"https://github.com/bwatters-r7","followers_url":"https://api.github.com/users/bwatters-r7/followers","following_url":"https://api.github.com/users/bwatters-r7/following{/other_user}","gists_url":"https://api.github.com/users/bwatters-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/bwatters-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwatters-r7/subscriptions","organizations_url":"https://api.github.com/users/bwatters-r7/orgs","repos_url":"https://api.github.com/users/bwatters-r7/repos","events_url":"https://api.github.com/users/bwatters-r7/events{/privacy}","received_events_url":"https://api.github.com/users/bwatters-r7/received_events","type":"User","site_admin":false},"body":"This fixes the bug reported in https://github.com/rapid7/metasploit-framework/issues/7236\r\n\r\nAs it exists currently, the assigned CPORT value never gets passed to the parent scanner object.  I imagine it was simply overlooked.  This fix simply passes the value up the chain as it was supposed to do.\r\n\r\n\r\n## Verification\r\n\r\nList the steps needed to make sure this thing works\r\n\r\n- [x] Start `msfconsole`\r\n- [x] `use auxiliary/scanner/smb/smb_login`\r\n- [x] `set rhosts <some_ip>`\r\n- [x] `run`\r\n- [x] **Verify** the module uses a random source port\r\n\r\n- [x] Start `msfconsole`\r\n- [x] `use auxiliary/scanner/smb/smb_login`\r\n- [x] `set rhosts <some_ip>'\r\n- [x] `set CPORT <some_port>`\r\n- [x] `run`\r\n- [x] **Verify** the module uses the assigned source port\r\n\r\n## My tests.......\r\n\r\n### CPORT OFF\r\n```\r\nbwatters@ubuntu:~/rapid7/metasploit-framework$ ./msfconsole -q\r\nmsf > use auxiliary/scanner/smb/smb_login \r\nmsf auxiliary(smb_login) > set rhosts <win8x64_IP>\r\nrhosts => <win8x64_IP>\r\nmsf auxiliary(smb_login) > run\r\n\r\n[*] <win8x64_IP>:445    - SMB - Starting SMB login bruteforce\r\n[*] <win8x64_IP>:445    - This system does not accept authentication with any credentials, proceeding with brute force\r\n[*] Scanned 1 of 1 hosts (100% complete)\r\n[*] Auxiliary module execution completed\r\n```\r\n![cport_off](https://cloud.githubusercontent.com/assets/17987018/18062503/c5b18ade-6dec-11e6-97ab-ddaa0adde8d4.JPG)\r\n\r\n### CPORT ON:\r\n```\r\nbwatters@ubuntu:~/rapid7/metasploit-framework$ ./msfconsole -q\r\nmsf > use auxiliary/scanner/smb/smb_login \r\nmsf auxiliary(smb_login) > set rhosts <win8x64_IP>\r\nrhosts => <win8x64_IP>\r\nmsf auxiliary(smb_login) > set cport 54321\r\ncport => 54321\r\nmsf auxiliary(smb_login) > run\r\n\r\n[*] <win8x64_IP>:445    - SMB - Starting SMB login bruteforce\r\n[*] <win8x64_IP>:445    - This system does not accept authentication with any credentials, proceeding with brute force\r\n[*] Scanned 1 of 1 hosts (100% complete)\r\n[*] Auxiliary module execution completed\r\n```\r\n\r\n![cport_on](https://cloud.githubusercontent.com/assets/17987018/18062394/4ea0b384-6dec-11e6-8734-97960ab0a1d0.JPG)\r\n\r\n","created_at":"2016-08-29T18:32:30Z","updated_at":"2016-08-30T05:56:48Z","closed_at":"2016-08-30T05:56:48Z","merged_at":"2016-08-30T05:56:48Z","merge_commit_sha":"b21ea2ba3f85ce77bfa9de90d351c0298d0e987b","assignee":{"login":"wvu-r7","id":4551878,"avatar_url":"https://avatars.githubusercontent.com/u/4551878?v=3","gravatar_id":"","url":"https://api.github.com/users/wvu-r7","html_url":"https://github.com/wvu-r7","followers_url":"https://api.github.com/users/wvu-r7/followers","following_url":"https://api.github.com/users/wvu-r7/following{/other_user}","gists_url":"https://api.github.com/users/wvu-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wvu-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wvu-r7/subscriptions","organizations_url":"https://api.github.com/users/wvu-r7/orgs","repos_url":"https://api.github.com/users/wvu-r7/repos","events_url":"https://api.github.com/users/wvu-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wvu-r7/received_events","type":"User","site_admin":false},"assignees":[{"login":"wvu-r7","id":4551878,"avatar_url":"https://avatars.githubusercontent.com/u/4551878?v=3","gravatar_id":"","url":"https://api.github.com/users/wvu-r7","html_url":"https://github.com/wvu-r7","followers_url":"https://api.github.com/users/wvu-r7/followers","following_url":"https://api.github.com/users/wvu-r7/following{/other_user}","gists_url":"https://api.github.com/users/wvu-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wvu-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wvu-r7/subscriptions","organizations_url":"https://api.github.com/users/wvu-r7/orgs","repos_url":"https://api.github.com/users/wvu-r7/repos","events_url":"https://api.github.com/users/wvu-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wvu-r7/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7251/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7251/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/7251/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/b21ea2ba3f85ce77bfa9de90d351c0298d0e987b","head":{"label":"bwatters-r7:fix_cport","ref":"fix_cport","sha":"b21ea2ba3f85ce77bfa9de90d351c0298d0e987b","user":{"login":"bwatters-r7","id":17987018,"avatar_url":"https://avatars.githubusercontent.com/u/17987018?v=3","gravatar_id":"","url":"https://api.github.com/users/bwatters-r7","html_url":"https://github.com/bwatters-r7","followers_url":"https://api.github.com/users/bwatters-r7/followers","following_url":"https://api.github.com/users/bwatters-r7/following{/other_user}","gists_url":"https://api.github.com/users/bwatters-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/bwatters-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwatters-r7/subscriptions","organizations_url":"https://api.github.com/users/bwatters-r7/orgs","repos_url":"https://api.github.com/users/bwatters-r7/repos","events_url":"https://api.github.com/users/bwatters-r7/events{/privacy}","received_events_url":"https://api.github.com/users/bwatters-r7/received_events","type":"User","site_admin":false},"repo":{"id":54574497,"name":"metasploit-framework","full_name":"bwatters-r7/metasploit-framework","owner":{"login":"bwatters-r7","id":17987018,"avatar_url":"https://avatars.githubusercontent.com/u/17987018?v=3","gravatar_id":"","url":"https://api.github.com/users/bwatters-r7","html_url":"https://github.com/bwatters-r7","followers_url":"https://api.github.com/users/bwatters-r7/followers","following_url":"https://api.github.com/users/bwatters-r7/following{/other_user}","gists_url":"https://api.github.com/users/bwatters-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/bwatters-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwatters-r7/subscriptions","organizations_url":"https://api.github.com/users/bwatters-r7/orgs","repos_url":"https://api.github.com/users/bwatters-r7/repos","events_url":"https://api.github.com/users/bwatters-r7/events{/privacy}","received_events_url":"https://api.github.com/users/bwatters-r7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bwatters-r7/metasploit-framework","description":"Metasploit Framework","fork":true,"url":"https://api.github.com/repos/bwatters-r7/metasploit-framework","forks_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/forks","keys_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/events","assignees_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/merges","archive_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/releases{/id}","deployments_url":"https://api.github.com/repos/bwatters-r7/metasploit-framework/deployments","created_at":"2016-03-23T16:12:09Z","updated_at":"2016-03-23T16:12:32Z","pushed_at":"2016-08-29T18:17:48Z","git_url":"git://github.com/bwatters-r7/metasploit-framework.git","ssh_url":"git@github.com:bwatters-r7/metasploit-framework.git","clone_url":"https://github.com/bwatters-r7/metasploit-framework.git","svn_url":"https://github.com/bwatters-r7/metasploit-framework","homepage":"http://www.metasploit.com/","size":287902,"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":"ea32c313d3596497be184161b784544100e0a3ec","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-08-30T02:12:23Z","pushed_at":"2016-08-30T05:56:43Z","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":1399680,"stargazers_count":6479,"watchers_count":6479,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4333,"mirror_url":null,"open_issues_count":320,"forks":4333,"open_issues":320,"watchers":6479,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7251"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/7251"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7251"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7251/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7251/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/7251/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/b21ea2ba3f85ce77bfa9de90d351c0298d0e987b"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"wvu-r7","id":4551878,"avatar_url":"https://avatars.githubusercontent.com/u/4551878?v=3","gravatar_id":"","url":"https://api.github.com/users/wvu-r7","html_url":"https://github.com/wvu-r7","followers_url":"https://api.github.com/users/wvu-r7/followers","following_url":"https://api.github.com/users/wvu-r7/following{/other_user}","gists_url":"https://api.github.com/users/wvu-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wvu-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wvu-r7/subscriptions","organizations_url":"https://api.github.com/users/wvu-r7/orgs","repos_url":"https://api.github.com/users/wvu-r7/repos","events_url":"https://api.github.com/users/wvu-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wvu-r7/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":1,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"wvu-r7"}}