{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/86200189","pull_request_review_id":6870043,"id":86200189,"diff_hunk":"@@ -66,6 +66,20 @@ def executable_path\n     @executable_path\n   end\n \n+\tdef check\n+\t\tversion = cmd_exec('pkexec --version')\n+\t\tif version.nil?\n+\t\t\tprint_error \"Policykit is not installed\"\n+\t\t\treturn CheckCode::Safe\n+\t\tend\n+\n+\t\tif version.split('.')[1].to_f <= 0.101\n+\t\t\treturn CheckCode::Vulnerable\n+\t\tend\n+\n+\t\tCheckCode::Unknown","path":"modules/exploits/linux/local/pkexec.rb","position":null,"original_position":15,"commit_id":"23ab4f1fc11185b4a584c907db0efb082c3f6672","original_commit_id":"2ac54f50284f179f099d45610627e5b90807210c","user":{"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},"body":"That's true, but backporting isn't applied to future versions, which are likely to be patched. Since you're using ```CheckCode::Appears``` instead of ```CheckCode::Vulnerable``` now, the logic is somewhat flipped.","created_at":"2016-11-02T17:38:39Z","updated_at":"2016-11-02T17:38:39Z","html_url":"https://github.com/rapid7/metasploit-framework/pull/7499#discussion_r86200189","pull_request_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7499","_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/86200189"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/7499#discussion_r86200189"},"pull_request":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7499"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7499","id":91155300,"html_url":"https://github.com/rapid7/metasploit-framework/pull/7499","diff_url":"https://github.com/rapid7/metasploit-framework/pull/7499.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/7499.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7499","number":7499,"state":"open","locked":false,"title":"Add a check for the linux pkexec module","user":{"login":"jvoisin","id":325724,"avatar_url":"https://avatars.githubusercontent.com/u/325724?v=3","gravatar_id":"","url":"https://api.github.com/users/jvoisin","html_url":"https://github.com/jvoisin","followers_url":"https://api.github.com/users/jvoisin/followers","following_url":"https://api.github.com/users/jvoisin/following{/other_user}","gists_url":"https://api.github.com/users/jvoisin/gists{/gist_id}","starred_url":"https://api.github.com/users/jvoisin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvoisin/subscriptions","organizations_url":"https://api.github.com/users/jvoisin/orgs","repos_url":"https://api.github.com/users/jvoisin/repos","events_url":"https://api.github.com/users/jvoisin/events{/privacy}","received_events_url":"https://api.github.com/users/jvoisin/received_events","type":"User","site_admin":false},"body":"The PR adds a `check` for the `exploit/linux/local/pkexec` module.\r\nPlease squash the PR before merging it.\r\n\r\n## Verification\r\n- [x] Start `msfconsole`\r\n- [x] Get a meterpreter session\r\n- [x] Put it in background\r\n- [x] `use` the `exploit/linux/local/pkexec` module\r\n- [x] run `check`, it should output say that the machine is vulnerable if `pkexec` is present and has a version inferior or equal to `0.101`\r\n## Example on a vulnerable instance\r\n\r\n```\r\nmsf exploit(handler) > run\r\n\r\n[*] Started reverse TCP handler on 127.0.0.1:8000 \r\n[*] Starting the payload handler...\r\n[*] Sending stage (2427448 bytes) to 127.0.0.1\r\n[*] Meterpreter session 2 opened (127.0.0.1:8000 -> 127.0.0.1:52304) at 2016-10-27 10:26:15 +0200\r\n\r\nmeterpreter > \r\nBackground session 2? [y/N]  \r\nmsf exploit(handler) > use exploit/linux/local/pkexec\r\nmsf exploit(pkexec) > set session 1\r\nsession => 1\r\nmsf exploit(pkexec) > check\r\n[+]  The target is vulnerable.\r\nmsf exploit(pkexec) >  \r\n```\r\n","created_at":"2016-10-27T08:35:25Z","updated_at":"2016-11-02T17:38:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13f4b6fd04216715c660f087fb33e48cca6f1b64","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/7499/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7499/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/7499/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/23ab4f1fc11185b4a584c907db0efb082c3f6672","head":{"label":"jvoisin:pkexec_check","ref":"pkexec_check","sha":"23ab4f1fc11185b4a584c907db0efb082c3f6672","user":{"login":"jvoisin","id":325724,"avatar_url":"https://avatars.githubusercontent.com/u/325724?v=3","gravatar_id":"","url":"https://api.github.com/users/jvoisin","html_url":"https://github.com/jvoisin","followers_url":"https://api.github.com/users/jvoisin/followers","following_url":"https://api.github.com/users/jvoisin/following{/other_user}","gists_url":"https://api.github.com/users/jvoisin/gists{/gist_id}","starred_url":"https://api.github.com/users/jvoisin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvoisin/subscriptions","organizations_url":"https://api.github.com/users/jvoisin/orgs","repos_url":"https://api.github.com/users/jvoisin/repos","events_url":"https://api.github.com/users/jvoisin/events{/privacy}","received_events_url":"https://api.github.com/users/jvoisin/received_events","type":"User","site_admin":false},"repo":{"id":45685309,"name":"metasploit-framework","full_name":"jvoisin/metasploit-framework","owner":{"login":"jvoisin","id":325724,"avatar_url":"https://avatars.githubusercontent.com/u/325724?v=3","gravatar_id":"","url":"https://api.github.com/users/jvoisin","html_url":"https://github.com/jvoisin","followers_url":"https://api.github.com/users/jvoisin/followers","following_url":"https://api.github.com/users/jvoisin/following{/other_user}","gists_url":"https://api.github.com/users/jvoisin/gists{/gist_id}","starred_url":"https://api.github.com/users/jvoisin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvoisin/subscriptions","organizations_url":"https://api.github.com/users/jvoisin/orgs","repos_url":"https://api.github.com/users/jvoisin/repos","events_url":"https://api.github.com/users/jvoisin/events{/privacy}","received_events_url":"https://api.github.com/users/jvoisin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jvoisin/metasploit-framework","description":"Metasploit Framework","fork":true,"url":"https://api.github.com/repos/jvoisin/metasploit-framework","forks_url":"https://api.github.com/repos/jvoisin/metasploit-framework/forks","keys_url":"https://api.github.com/repos/jvoisin/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jvoisin/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jvoisin/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/jvoisin/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/jvoisin/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/jvoisin/metasploit-framework/events","assignees_url":"https://api.github.com/repos/jvoisin/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/jvoisin/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/jvoisin/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/jvoisin/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jvoisin/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jvoisin/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/jvoisin/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jvoisin/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/jvoisin/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/jvoisin/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/jvoisin/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/jvoisin/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/jvoisin/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/jvoisin/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/jvoisin/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/jvoisin/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/jvoisin/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/jvoisin/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/jvoisin/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jvoisin/metasploit-framework/merges","archive_url":"https://api.github.com/repos/jvoisin/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jvoisin/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/jvoisin/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/jvoisin/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/jvoisin/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/jvoisin/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jvoisin/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/jvoisin/metasploit-framework/releases{/id}","deployments_url":"https://api.github.com/repos/jvoisin/metasploit-framework/deployments","created_at":"2015-11-06T14:03:16Z","updated_at":"2016-09-28T11:33:40Z","pushed_at":"2016-11-02T17:22:07Z","git_url":"git://github.com/jvoisin/metasploit-framework.git","ssh_url":"git@github.com:jvoisin/metasploit-framework.git","clone_url":"https://github.com/jvoisin/metasploit-framework.git","svn_url":"https://github.com/jvoisin/metasploit-framework","homepage":"http://www.metasploit.com/","size":285870,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"a7c8060af589367f271b7f387887ba69f0c3966a","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-11-02T16:35:18Z","pushed_at":"2016-11-02T17:16:59Z","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":1422035,"stargazers_count":6975,"watchers_count":6975,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4553,"mirror_url":null,"open_issues_count":327,"forks":4553,"open_issues":327,"watchers":6975,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7499"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/7499"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7499"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7499/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7499/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/7499/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/23ab4f1fc11185b4a584c907db0efb082c3f6672"}}}}
{"actor":{"display_login":"wvu-r7"}}