{"id":18719,"date":"2021-02-17T00:36:00","date_gmt":"2021-02-16T23:36:00","guid":{"rendered":"http:\/\/159.69.82.204\/win\/?p=18719"},"modified":"2021-03-22T13:30:11","modified_gmt":"2021-03-22T12:30:11","slug":"privilege-escalation-schwachstelle-in-der-windows-shell","status":"publish","type":"post","link":"https:\/\/borncity.com\/win\/2021\/02\/17\/privilege-escalation-schwachstelle-in-der-windows-shell\/","title":{"rendered":"Privilege Escalation vulnerability in Windows Shell"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"float: left; margin: 0px 10px 0px 0px; display: inline\" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2013\/03\/winb.jpg\" width=\"58\" align=\"left\" height=\"58\">[<a href=\"https:\/\/www.borncity.com\/blog\/?p=249451\" target=\"_blank\" rel=\"noopener\">German<\/a>]Today another topic that has been on my agenda for a while. There is a privilege escalation vulnerability in the Windows shell that allows a local attacker to escalate user privileges. But it's quite difficult and can only be exploited locally. <\/p>\n<p><!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"https:\/\/vg09.met.vgwort.de\/na\/08e30f19a65741009155343ee13a5d3b\" width=\"1\" height=\"1\">Memory-wise, this has never been more widely addressed. i came across it via the following <a href=\"https:\/\/twitter.com\/jonasLyk\/status\/1302311297619578883\" target=\"_blank\" rel=\"noopener\">tweet<\/a> from Jonas L, who has already disclosed several vulnerabilities in Windows. <\/p>\n<p><a href=\"https:\/\/twitter.com\/jonasLyk\/status\/1302311297619578883\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/IiLGR87.png\"><\/a><\/p>\n<p>The vulnerability is outlined in <a href=\"https:\/\/docs.google.com\/document\/d\/e\/2PACX-1vTP5OvJToWToMOKyeMyPcIPJhqbnESgWY6dYje9seJY96-ezCEJbXsMkfMWhoqPRaCNRs6BOO7urQyF\/pub\" target=\"_blank\" rel=\"noopener\">this Google Docs document<\/a>. When the user changes the profile picture of a user account, DCOM triggers a call to the Shell Create Object Task Server as the system and writes the new picture to <em>C:\\users\\public\\AccountPictures<\/em>. However, exploiting this vulnerability for local privilege elevation proved difficult, the discoverer writes. After failing three times already, he still found a trick that led to the goal. The approach is based on James Forshaw's hints and can be <a href=\"https:\/\/web.archive.org\/web\/20201108095054\/https:\/\/www.alchemistowl.org\/pocorgtfo\/pocorgtfo13.pdf\" target=\"_blank\" rel=\"noopener\">read here<\/a>. <\/p>\n<p>Basically it is about how to craft a path in the NT object namespace that takes as long as possible to parse. If the user account picture is changed, this triggers different file actions in the path <em>c:\\users\\public\\AccountPictures<\/em>):<\/p>\n<pre><code>\\AccountPictures\\S-1-5-21-2781542633-746229175-3265460138-1001\n\nIs checked if it redirects to another path.\n\n\n\\S-1-5-21-2781542633-746229175-3265460138-1001\\{2E84DAF4-572D-4F17-A374-336A1E77E9B6}-Image96.jpg\n\nIs created, notice that the filename contains an random GUID\n\n\n\\S-1-5-21-2781542633-746229175-3265460138-1001\\{2E84DAF4-572D-4F17-A374-336A1E77E9B6}-Image96.tmp\n\nIs created\n\n\n\\S-1-5-21-2781542633-746229175-3265460138-1001\\~2E84DAF4-572D-4F17-A374-336A1E77E9B6}-Image96.tmp\n\nIs created and the calling user is granted full permission to the file.\n\n\n\\S-1-5-21-2781542633-746229175-3265460138-1001\\{2E84DAF4-572D-4F17-A374-336A1E77E9B6}-Image96.jpg~RFb1bdf30.TMP\n\nIs created<\/code><\/pre>\n<p>Then the process repeats for image32 instead of image96 and continues with 192, 40, 448, 32 ,48 ,240 ,96. If an attacker manages to redirect the file to which the calling user has full permission to a different location and filename, he can inject a <em>sideloading dll<\/em> into system32 and place his own payload.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/FiB-zMl3LPqienNa6DhugSp1yJSgz-qMAEstaa8byWFJmGzCk-5BRhtF6yaH2g29Jqtj30_teGVJwM2rwTXuMr6A1o-X4DINg32R17rY_Fjch1qgdG8P5H9S7Pikll2FNHBQsso\"><\/p>\n<p>Within <a href=\"https:\/\/docs.google.com\/document\/d\/e\/2PACX-1vTP5OvJToWToMOKyeMyPcIPJhqbnESgWY6dYje9seJY96-ezCEJbXsMkfMWhoqPRaCNRs6BOO7urQyF\/pub\" target=\"_blank\" rel=\"noopener\">this Google Docs document<\/a> Jonas L. outlines, how to find out the name of the file and exploit it in a proof of concept (PoC). It is not a critical vulnerability, as exploitation is very complex to exploit and requires the user's cooperation (he would have to change his user account picture). However, the episode shows that the devil often lurks in the details. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[German]Today another topic that has been on my agenda for a while. There is a privilege escalation vulnerability in the Windows shell that allows a local attacker to escalate user privileges. But it's quite difficult and can only be exploited &hellip; <a href=\"https:\/\/borncity.com\/win\/2021\/02\/17\/privilege-escalation-schwachstelle-in-der-windows-shell\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[580,2],"tags":[69,194],"class_list":["post-18719","post","type-post","status-publish","format-standard","hentry","category-security","category-windows","tag-security","tag-windows"],"_links":{"self":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/18719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/comments?post=18719"}],"version-history":[{"count":0,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/18719\/revisions"}],"wp:attachment":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/media?parent=18719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/categories?post=18719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/tags?post=18719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}